Added THEORIES cmake option

This commit is contained in:
Snaipe 2015-11-27 15:53:10 +01:00
parent 5101a514a3
commit c4bc28b7fb
4 changed files with 49 additions and 11 deletions

View file

@ -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)

View file

@ -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

View file

@ -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}")

View file

@ -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