1 # Copyright (c) 2018 Yubico AB. All rights reserved. 2 # Use of this source code is governed by a BSD-style 3 # license that can be found in the LICENSE file. 4 # SPDX-License-Identifier: BSD-2-Clause 5 6 list(APPEND COMPAT_SOURCES 7 ../openbsd-compat/clock_gettime.c 8 ../openbsd-compat/getopt_long.c 9 ../openbsd-compat/strlcat.c 10 ../openbsd-compat/strlcpy.c 11 ) 12 13 if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MSYS) 14 list(APPEND COMPAT_SOURCES ../openbsd-compat/posix_win.c) 15 endif() 16 17 # enable -Wconversion -Wsign-conversion 18 if(NOT MSVC) 19 set_source_files_properties(assert.c cred.c info.c manifest.c reset.c 20 retries.c setpin.c util.c PROPERTIES COMPILE_FLAGS 21 "-Wconversion -Wsign-conversion") 22 endif() 23 24 # manifest 25 add_executable(manifest manifest.c ${COMPAT_SOURCES}) 26 target_link_libraries(manifest ${_FIDO2_LIBRARY}) 27 28 # info 29 add_executable(info info.c ${COMPAT_SOURCES}) 30 target_link_libraries(info ${_FIDO2_LIBRARY}) 31 32 # reset 33 add_executable(reset reset.c util.c ${COMPAT_SOURCES}) 34 target_link_libraries(reset ${_FIDO2_LIBRARY}) 35 36 # cred 37 add_executable(cred cred.c util.c ${COMPAT_SOURCES}) 38 target_link_libraries(cred ${_FIDO2_LIBRARY}) 39 40 # assert 41 add_executable(assert assert.c util.c ${COMPAT_SOURCES}) 42 target_link_libraries(assert ${_FIDO2_LIBRARY}) 43 44 # setpin 45 add_executable(setpin setpin.c ${COMPAT_SOURCES}) 46 target_link_libraries(setpin ${_FIDO2_LIBRARY}) 47 48 # retries 49 add_executable(retries retries.c ${COMPAT_SOURCES}) 50 target_link_libraries(retries ${_FIDO2_LIBRARY}) 51 52 # select 53 add_executable(select select.c ${COMPAT_SOURCES}) 54 target_link_libraries(select ${_FIDO2_LIBRARY}) 55 56 if(MINGW) 57 # needed for nanosleep() in mingw 58 target_link_libraries(select winpthread) 59 endif() 60