Skip to content

Commit

Permalink
cmake: add BUILD_TESTING support
Browse files Browse the repository at this point in the history
Currently tests/ requires pulling gtest from git, which is far from
ideal for distribution builds (not to mention we don't need to unit test
in an RPM build). So add the ability to disable tests/ builds.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
  • Loading branch information
cyphar committed Jan 15, 2019
1 parent 96389e4 commit a56ab12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_compile_options("-Wno-format-security")
#add_compile_options("-Wstrict-overflow=5")
#add_compile_options("-Wdisabled-optimization")

enable_testing()
include(CTest)

if (STATIC_LINKING)
set(CMAKE_EXE_LINKER_FLAGS "-static")
Expand Down Expand Up @@ -59,7 +59,9 @@ include_directories(${CLANG_INCLUDE_DIRS})
add_subdirectory(src/arch)
add_subdirectory(src/ast)
add_subdirectory(src)
add_subdirectory(tests)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
add_subdirectory(resources)
add_subdirectory(tools)
add_subdirectory(man)

0 comments on commit a56ab12

Please sign in to comment.