Build tests by default when backward is a top level project

This commit is contained in:
Zsolt Parragi 2019-08-24 07:44:30 +02:00
parent 377cd4b66c
commit 7cf5ece17d

View File

@ -41,8 +41,12 @@ set(STACK_DETAILS_BFD FALSE CACHE BOOL
set(STACK_DETAILS_DWARF FALSE CACHE BOOL
"Use libdwarf/libelf to read debug info")
set(BACKWARD_TESTS FALSE CACHE BOOL "Enable tests")
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT DEFINED BACKWARD_TESTS)
# If this is a top level CMake project, we most lixely want the tests
set(BACKWARD_TESTS ON CACHE BOOL "Enable tests")
else()
set(BACKWARD_TESTS OFF CACHE BOOL "Enable tests")
endif()
###############################################################################
# CONFIGS
###############################################################################