diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 926e7f2..3cf62e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
@@ -31,11 +31,14 @@ list(APPEND FIDO_SOURCES | |||
31 | ) | 31 | ) |
32 | 32 | ||
33 | if(FUZZ) | 33 | if(FUZZ) |
34 | list(APPEND FIDO_SOURCES ../fuzz/prng.c) | ||
34 | list(APPEND FIDO_SOURCES ../fuzz/uniform_random.c) | 35 | list(APPEND FIDO_SOURCES ../fuzz/uniform_random.c) |
35 | list(APPEND FIDO_SOURCES ../fuzz/wrap.c) | 36 | list(APPEND FIDO_SOURCES ../fuzz/wrap.c) |
36 | endif() | 37 | endif() |
37 | 38 | ||
38 | if(WIN32) | 39 | if(USE_HIDAPI) |
40 | list(APPEND COMPAT_SOURCES hid_hidapi.c) | ||
41 | elseif(WIN32) | ||
39 | list(APPEND COMPAT_SOURCES hid_win.c) | 42 | list(APPEND COMPAT_SOURCES hid_win.c) |
40 | elseif(APPLE) | 43 | elseif(APPLE) |
41 | list(APPEND COMPAT_SOURCES hid_osx.c) | 44 | list(APPEND COMPAT_SOURCES hid_osx.c) |
@@ -43,6 +46,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") | |||
43 | list(APPEND COMPAT_SOURCES hid_linux.c) | 46 | list(APPEND COMPAT_SOURCES hid_linux.c) |
44 | elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") | 47 | elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") |
45 | list(APPEND COMPAT_SOURCES hid_openbsd.c) | 48 | list(APPEND COMPAT_SOURCES hid_openbsd.c) |
49 | else() | ||
50 | message(FATAL_ERROR "please define a hid backend for your platform") | ||
46 | endif() | 51 | endif() |
47 | 52 | ||
48 | list(APPEND COMPAT_SOURCES | 53 | list(APPEND COMPAT_SOURCES |
@@ -50,13 +55,14 @@ list(APPEND COMPAT_SOURCES | |||
50 | ../openbsd-compat/explicit_bzero.c | 55 | ../openbsd-compat/explicit_bzero.c |
51 | ../openbsd-compat/explicit_bzero_win32.c | 56 | ../openbsd-compat/explicit_bzero_win32.c |
52 | ../openbsd-compat/recallocarray.c | 57 | ../openbsd-compat/recallocarray.c |
58 | ../openbsd-compat/strlcat.c | ||
53 | ../openbsd-compat/timingsafe_bcmp.c | 59 | ../openbsd-compat/timingsafe_bcmp.c |
54 | ) | 60 | ) |
55 | 61 | ||
56 | # static library | 62 | # static library |
57 | add_library(fido2 STATIC ${FIDO_SOURCES} ${COMPAT_SOURCES}) | 63 | add_library(fido2 STATIC ${FIDO_SOURCES} ${COMPAT_SOURCES}) |
58 | target_link_libraries(fido2 ${CBOR_LIBRARIES} ${CRYPTO_LIBRARIES} | 64 | target_link_libraries(fido2 ${CBOR_LIBRARIES} ${CRYPTO_LIBRARIES} |
59 | ${UDEV_LIBRARIES} ${BASE_LIBRARIES}) | 65 | ${UDEV_LIBRARIES} ${BASE_LIBRARIES} ${HIDAPI_LIBRARIES}) |
60 | if(WIN32) | 66 | if(WIN32) |
61 | if (MINGW) | 67 | if (MINGW) |
62 | target_link_libraries(fido2 wsock32 ws2_32 bcrypt setupapi hid) | 68 | target_link_libraries(fido2 wsock32 ws2_32 bcrypt setupapi hid) |
@@ -74,7 +80,7 @@ install(TARGETS fido2 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | |||
74 | # dynamic library | 80 | # dynamic library |
75 | add_library(fido2_shared SHARED ${FIDO_SOURCES} ${COMPAT_SOURCES}) | 81 | add_library(fido2_shared SHARED ${FIDO_SOURCES} ${COMPAT_SOURCES}) |
76 | target_link_libraries(fido2_shared ${CBOR_LIBRARIES} ${CRYPTO_LIBRARIES} | 82 | target_link_libraries(fido2_shared ${CBOR_LIBRARIES} ${CRYPTO_LIBRARIES} |
77 | ${UDEV_LIBRARIES} ${BASE_LIBRARIES}) | 83 | ${UDEV_LIBRARIES} ${BASE_LIBRARIES} ${HIDAPI_LIBRARIES}) |
78 | if(WIN32) | 84 | if(WIN32) |
79 | if (MINGW) | 85 | if (MINGW) |
80 | target_link_libraries(fido2_shared wsock32 ws2_32 bcrypt | 86 | target_link_libraries(fido2_shared wsock32 ws2_32 bcrypt |