diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c32d64..21356c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${MODULE_DIR}) set(LIBCSPTR_DISABLE_TESTS ON) set(LIBCSPTR_DISABLE_COVERALLS ON) +# Content options + +option(THEORIES "Activate the support for theories" ON) + +# Initialization + include(Submodules) include(Capabilities) @@ -15,7 +21,11 @@ if (MSVC) endif () add_subdirectory(dependencies/libcsptr/ EXCLUDE_FROM_ALL) -add_subdirectory(dependencies/dyncall/ EXCLUDE_FROM_ALL) + +if (THEORIES) + add_subdirectory(dependencies/dyncall/ EXCLUDE_FROM_ALL) + include_directories(dependencies/dyncall/dyncall/) +endif () include_directories(SYSTEM /usr/local/include @@ -24,7 +34,6 @@ include_directories(SYSTEM include_directories( dependencies/libcsptr/include/ - dependencies/dyncall/dyncall/ dependencies/valgrind/include/ dependencies/klib/ ) @@ -140,7 +149,6 @@ set(SOURCE_FILES src/core/stats.c src/core/stats.h src/core/ordered-set.c - src/core/theories.c src/compat/internal.h src/compat/pipe.c src/compat/pipe.h @@ -180,6 +188,12 @@ set(SOURCE_FILES src/config.h ) +if (THEORIES) + set (SOURCE_FILES ${SOURCE_FILES} + src/core/theories.c + ) +endif () + if (PCRE_FOUND) set (SOURCE_FILES ${SOURCE_FILES} src/string/extmatch.c @@ -215,7 +229,6 @@ set(INTERFACE_FILES include/criterion/types.h include/criterion/options.h include/criterion/stats.h - include/criterion/theories.h include/criterion/alloc.h include/criterion/parameterized.h include/criterion/redirect.h @@ -227,7 +240,6 @@ set(INTERFACE_FILES include/criterion/internal/asprintf-compat.h include/criterion/internal/designated-initializer-compat.h include/criterion/internal/preprocess.h - include/criterion/internal/theories.h include/criterion/internal/parameterized.h include/criterion/internal/stdio_filebuf.hxx include/criterion/internal/stream.hxx @@ -236,6 +248,13 @@ set(INTERFACE_FILES include/criterion/internal/stdio_filebuf.hxx ) +if (THEORIES) + set(INTERFACE_FILES ${INTERFACE_FILES} + include/criterion/theories.h + include/criterion/internal/theories.h + ) +endif() + # Generate the configure file configure_file( @@ -245,7 +264,11 @@ configure_file( include_directories(include src) add_library(criterion SHARED ${SOURCE_FILES} ${INTERFACE_FILES}) -target_link_libraries(criterion csptr dyncall_s) +target_link_libraries(criterion csptr) + +if (THEORIES) + target_link_libraries(criterion dyncall_s) +endif () if (MSVC) target_link_libraries(criterion wingetopt) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index e56eeae..799a758 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -14,7 +14,6 @@ set(SAMPLES more-suites.c description.c simple.c - theories.c timeout.c redirect.c parameterized.c @@ -31,12 +30,18 @@ if (CMAKE_CXX_COMPILER_WORKS) more-suites.cc description.cc simple.cc - theories.cc redirect.cc parameterized.cc ) endif () +if (THEORIES) + set(SAMPLES ${SAMPLES} theories.c) + if (CMAKE_CXX_COMPILER_WORKS) + set(SAMPLES ${SAMPLES} theories.cc) + endif () +endif () + set(SCRIPTS tap_test xml_test diff --git a/samples/tests/CMakeLists.txt b/samples/tests/CMakeLists.txt index 4a38382..9432b91 100644 --- a/samples/tests/CMakeLists.txt +++ b/samples/tests/CMakeLists.txt @@ -3,7 +3,6 @@ set(SAMPLES exit.c long-messages.c other-crashes.c - theories_regression.c ) @@ -13,10 +12,16 @@ if (CMAKE_CXX_COMPILER_WORKS) exit.cc long-messages.cc other-crashes.cc - theories_regression.cc exception.cc ) endif () +if (THEORIES) + set(SAMPLES ${SAMPLES} theories_regression.c) + if (CMAKE_CXX_COMPILER_WORKS) + set(SAMPLES ${SAMPLES} theories_regression.cc) + endif () +endif () + add_samples("${CMAKE_CURRENT_LIST_DIR}" "${SAMPLES}") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3e7c747..f23ac22 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,9 +9,14 @@ include_directories(../include ../src) set(TEST_SOURCES ordered-set.c - asprintf.c ) +if (THEORIES) + set(TEST_SOURCES ${TEST_SOURCES} + asprintf.c + ) +endif () + if (CMAKE_CXX_COMPILER_WORKS) set(TEST_SOURCES ${TEST_SOURCES} redirect.cc