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
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
13 if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MSYS)
14 list(APPEND COMPAT_SOURCES ../openbsd-compat/posix_win.c)
17 # enable -Wconversion -Wsign-conversion
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")
25 add_executable(manifest manifest.c ${COMPAT_SOURCES})
26 target_link_libraries(manifest ${_FIDO2_LIBRARY})
29 add_executable(info info.c ${COMPAT_SOURCES})
30 target_link_libraries(info ${_FIDO2_LIBRARY})
33 add_executable(reset reset.c util.c ${COMPAT_SOURCES})
34 target_link_libraries(reset ${_FIDO2_LIBRARY})
37 add_executable(cred cred.c util.c ${COMPAT_SOURCES})
38 target_link_libraries(cred ${_FIDO2_LIBRARY})
41 add_executable(assert assert.c util.c ${COMPAT_SOURCES})
42 target_link_libraries(assert ${_FIDO2_LIBRARY})
45 add_executable(setpin setpin.c ${COMPAT_SOURCES})
46 target_link_libraries(setpin ${_FIDO2_LIBRARY})
49 add_executable(retries retries.c ${COMPAT_SOURCES})
50 target_link_libraries(retries ${_FIDO2_LIBRARY})
53 add_executable(select select.c ${COMPAT_SOURCES})
54 target_link_libraries(select ${_FIDO2_LIBRARY})
57 # needed for nanosleep() in mingw
58 target_link_libraries(select winpthread)