diffblue-cbmc/unit/CMakeLists.txt

69 lines
1.9 KiB
CMake
Raw Normal View History

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
)
# private is overwritten in the gdb_api test cases
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-keyword-macro")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# This would be the place to enable warnings for Windows builds, although
# config.inc doesn't seem to do that currently
endif()
file(GLOB_RECURSE sources "*.cpp" "*.h")
2017-10-10 01:29:51 +08:00
file(GLOB_RECURSE testing_utils "testing-utils/*.cpp" "testing-utils/*.h")
if(NOT WITH_MEMORY_ANALYZER)
file(GLOB_RECURSE memory_analyzer_sources "memory-analyzer/*.cpp")
list(REMOVE_ITEM sources ${memory_analyzer_sources})
endif()
2017-08-31 00:10:45 +08:00
list(REMOVE_ITEM sources
# Don't build
${CMAKE_CURRENT_SOURCE_DIR}/elf_reader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/smt2_parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/json.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp_parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/osx_fat_reader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp_scanner.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ieee_float.cpp
2017-09-20 00:26:52 +08:00
2017-10-10 01:29:51 +08:00
# Will be built into a separate library and linked
${testing_utils}
2017-09-20 00:26:52 +08:00
# Intended to fail to compile
${CMAKE_CURRENT_SOURCE_DIR}/util/expr_cast/expr_undefined_casts.cpp
2017-08-31 00:10:45 +08:00
)
2017-10-10 01:29:51 +08:00
add_subdirectory(testing-utils)
add_executable(unit ${sources})
2017-08-31 00:10:45 +08:00
target_include_directories(unit
PUBLIC
${CBMC_BINARY_DIR}
${CBMC_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CUDD_INCLUDE}
2017-08-31 00:10:45 +08:00
)
target_link_libraries(
unit
testing-utils
ansi-c
solvers
goto-checker
goto-programs
goto-instrument-lib
goto-symex
cbmc-lib
json-symtab-language
statement-list
)
2017-08-31 00:17:38 +08:00
add_test(
NAME unit
COMMAND $<TARGET_FILE:unit>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
2017-10-12 18:42:50 +08:00
set_tests_properties(unit PROPERTIES LABELS "CORE;CBMC")