From f58d3dbdbc2cac8e4db47d12a44ed8bbc5637fa2 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 21 Aug 2019 11:38:09 +0300 Subject: [PATCH] Add staticrootstest to CMake script * CMakeLists.txt [build_tests && !(BUILD_SHARED_LIBS && WIN32)] (staticrootslib_test, staticrootslib2_test): Add library specification. * CMakeLists.txt [build_tests && !(BUILD_SHARED_LIBS && WIN32)] (staticrootstest): Add executable and test specification. * CMakeLists.txt [build_tests && !(BUILD_SHARED_LIBS && WIN32)] (staticrootslib2_test, staticrootstest): Specify target compile option. --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eacea37f..9d31ea30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,19 @@ if (build_tests) target_link_libraries(smashtest PRIVATE gc) add_test(NAME smashtest COMMAND smashtest) + if (NOT (BUILD_SHARED_LIBS AND WIN32)) + add_library(staticrootslib_test tests/staticrootslib.c) + target_link_libraries(staticrootslib_test PRIVATE gc) + add_library(staticrootslib2_test tests/staticrootslib.c) + target_compile_options(staticrootslib2_test PRIVATE "-DSTATICROOTSLIB2") + target_link_libraries(staticrootslib2_test PRIVATE gc) + add_executable(staticrootstest tests/staticrootstest.c) + target_compile_options(staticrootstest PRIVATE "-DSTATICROOTSLIB2") + target_link_libraries(staticrootstest PRIVATE + gc staticrootslib_test staticrootslib2_test) + add_test(NAME staticrootstest COMMAND staticrootstest) + endif() + if (enable_gc_debug) add_executable(tracetest tests/trace_test.c) target_link_libraries(tracetest PRIVATE gc) -- 2.40.0