Debian Codegraph @

3rdparty/nlohmann_json/tests/abi/diag/CMakeLists.txt

raw
1 # test linking library built with different JSON_DIAGNOSTICS setting
2 # into the same executable
3
4 # compile code using JSON_DIAGNOSTICS=1
5 add_library(abi_compat_diag_on STATIC diag_on.cpp)
6 target_link_libraries(abi_compat_diag_on PUBLIC abi_compat_common)
7
8 # compile code using JSON_DIAGNOSTICS=0
9 add_library(abi_compat_diag_off STATIC diag_off.cpp)
10 target_link_libraries(abi_compat_diag_off PUBLIC abi_compat_common)
11
12 # build test executable and add test
13 add_executable(abi_compat_diag diag.cpp)
14 target_link_libraries(abi_compat_diag PRIVATE
15 abi_compat_main abi_compat_diag_on abi_compat_diag_off)
16
17 add_test(
18 NAME test-abi_compat_diag
19 COMMAND abi_compat_diag ${DOCTEST_TEST_FILTER})