@@ -1001,10 +1001,14 @@ parse_makefile_for_sources(unit-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "UNIT_
1001
1001
list (TRANSFORM unit-test_SOURCES REPLACE "\\ $\\ (UNIT_TEST_DIR\\ )/" "${CMAKE_SOURCE_DIR} /t/unit-tests/" )
1002
1002
add_library (unit-test-lib STATIC ${unit-test_SOURCES} )
1003
1003
1004
+ parse_makefile_for_sources (clar-test_SOURCES ${CMAKE_SOURCE_DIR} /Makefile "CLAR_TEST_OBJS" )
1005
+ list (TRANSFORM clar-test_SOURCES REPLACE "\\ $\\ (UNIT_TEST_DIR\\ )/" "${CMAKE_SOURCE_DIR} /t/unit-tests/" )
1006
+ add_library (clar-test-lib STATIC ${clar-test_SOURCES} )
1007
+
1004
1008
parse_makefile_for_scripts (unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "" )
1005
1009
foreach (unit_test ${unit_test_PROGRAMS} )
1006
1010
add_executable ("${unit_test} " "${CMAKE_SOURCE_DIR} /t/unit-tests/${unit_test} .c" )
1007
- target_link_libraries ("${unit_test} " unit-test-lib common-main )
1011
+ target_link_libraries ("${unit_test} " unit-test-lib clar-test-lib common-main )
1008
1012
set_target_properties ("${unit_test} "
1009
1013
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /t/unit-tests/bin )
1010
1014
if (MSVC )
@@ -1046,13 +1050,13 @@ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
1046
1050
VERBATIM )
1047
1051
1048
1052
add_library (unit-tests-lib ${clar_test_SUITES}
1049
- "${CMAKE_SOURCE_DIR} /t/unit-tests/clar/clar.c"
1050
1053
"${CMAKE_BINARY_DIR} /t/unit-tests/clar-decls.h"
1051
1054
"${CMAKE_BINARY_DIR} /t/unit-tests/clar.suite"
1052
1055
)
1056
+ target_include_directories (clar-test-lib PUBLIC "${CMAKE_BINARY_DIR} /t/unit-tests" )
1053
1057
target_include_directories (unit-tests-lib PUBLIC "${CMAKE_BINARY_DIR} /t/unit-tests" )
1054
- add_executable (unit-tests " ${CMAKE_SOURCE_DIR} /t/unit-tests/unit-test.c" )
1055
- target_link_libraries (unit-tests unit-tests-lib common-main )
1058
+ add_executable (unit-tests )
1059
+ target_link_libraries (unit-tests unit-tests-lib clar-test-lib common-main )
1056
1060
set_target_properties (unit-tests
1057
1061
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /t/unit-tests/bin )
1058
1062
if (MSVC )
0 commit comments