xref: /freebsd/contrib/libfido2/tools/CMakeLists.txt (revision 2ccfa855b2fc331819953e3de1b1c15ce5b95a7e)
1*2ccfa855SEd Maste# Copyright (c) 2018-2022 Yubico AB. All rights reserved.
20afa8e06SEd Maste# Use of this source code is governed by a BSD-style
30afa8e06SEd Maste# license that can be found in the LICENSE file.
4*2ccfa855SEd Maste# SPDX-License-Identifier: BSD-2-Clause
50afa8e06SEd Maste
60afa8e06SEd Mastelist(APPEND COMPAT_SOURCES
7f540a430SEd Maste	../openbsd-compat/bsd-getpagesize.c
80afa8e06SEd Maste	../openbsd-compat/explicit_bzero.c
90afa8e06SEd Maste	../openbsd-compat/freezero.c
10f540a430SEd Maste	../openbsd-compat/recallocarray.c
110afa8e06SEd Maste	../openbsd-compat/strlcat.c
120afa8e06SEd Maste	../openbsd-compat/strlcpy.c
13f540a430SEd Maste	../openbsd-compat/strsep.c
140afa8e06SEd Maste)
150afa8e06SEd Maste
160afa8e06SEd Masteif(WIN32 AND NOT CYGWIN AND NOT MSYS)
170afa8e06SEd Maste	list(APPEND COMPAT_SOURCES
180afa8e06SEd Maste		../openbsd-compat/bsd-getline.c
190afa8e06SEd Maste		../openbsd-compat/endian_win32.c
200afa8e06SEd Maste		../openbsd-compat/explicit_bzero_win32.c
210afa8e06SEd Maste		../openbsd-compat/getopt_long.c
220afa8e06SEd Maste		../openbsd-compat/readpassphrase_win32.c
230afa8e06SEd Maste	)
240afa8e06SEd Maste	if (BUILD_SHARED_LIBS)
250afa8e06SEd Maste		list(APPEND COMPAT_SOURCES ../openbsd-compat/posix_win.c)
260afa8e06SEd Maste	endif()
270afa8e06SEd Masteelse()
280afa8e06SEd Maste	list(APPEND COMPAT_SOURCES ../openbsd-compat/readpassphrase.c)
290afa8e06SEd Masteendif()
300afa8e06SEd Maste
310afa8e06SEd Masteif(NOT MSVC)
320afa8e06SEd Maste	set_source_files_properties(assert_get.c assert_verify.c base64.c bio.c
330afa8e06SEd Maste	    config.c cred_make.c cred_verify.c credman.c fido2-assert.c
340afa8e06SEd Maste	    fido2-cred.c fido2-token.c pin.c token.c util.c
35*2ccfa855SEd Maste	    PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS}")
360afa8e06SEd Masteendif()
370afa8e06SEd Maste
380afa8e06SEd Masteadd_executable(fido2-cred
390afa8e06SEd Maste	fido2-cred.c
400afa8e06SEd Maste	cred_make.c
410afa8e06SEd Maste	cred_verify.c
420afa8e06SEd Maste	base64.c
430afa8e06SEd Maste	util.c
440afa8e06SEd Maste	${COMPAT_SOURCES}
450afa8e06SEd Maste)
460afa8e06SEd Maste
470afa8e06SEd Masteadd_executable(fido2-assert
480afa8e06SEd Maste	fido2-assert.c
490afa8e06SEd Maste	assert_get.c
500afa8e06SEd Maste	assert_verify.c
510afa8e06SEd Maste	base64.c
520afa8e06SEd Maste	util.c
530afa8e06SEd Maste	${COMPAT_SOURCES}
540afa8e06SEd Maste)
550afa8e06SEd Maste
560afa8e06SEd Masteadd_executable(fido2-token
570afa8e06SEd Maste	fido2-token.c
580afa8e06SEd Maste	base64.c
590afa8e06SEd Maste	bio.c
600afa8e06SEd Maste	config.c
610afa8e06SEd Maste	credman.c
620afa8e06SEd Maste	largeblob.c
630afa8e06SEd Maste	pin.c
640afa8e06SEd Maste	token.c
650afa8e06SEd Maste	util.c
660afa8e06SEd Maste	${COMPAT_SOURCES}
670afa8e06SEd Maste)
680afa8e06SEd Maste
690afa8e06SEd Mastetarget_link_libraries(fido2-cred ${CRYPTO_LIBRARIES} ${_FIDO2_LIBRARY})
700afa8e06SEd Mastetarget_link_libraries(fido2-assert ${CRYPTO_LIBRARIES} ${_FIDO2_LIBRARY})
710afa8e06SEd Mastetarget_link_libraries(fido2-token ${CRYPTO_LIBRARIES} ${_FIDO2_LIBRARY})
720afa8e06SEd Maste
730afa8e06SEd Masteinstall(TARGETS fido2-cred fido2-assert fido2-token
740afa8e06SEd Maste	DESTINATION ${CMAKE_INSTALL_BINDIR})
75