Skip to content

Commit

Permalink
Only build unit tests for standalong project
Browse files Browse the repository at this point in the history
  • Loading branch information
wwylele committed Dec 18, 2018
1 parent 9c822d2 commit ce80ae4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ endif()

option(TEAKRA_WARNINGS_AS_ERRORS "Warnings as errors" ${MASTER_PROJECT})
option(TEAKRA_BUILD_TOOLS "Build tools" ${MASTER_PROJECT})
option(TEAKRA_BUILD_UNIT_TESTS "Build unit tests" ${MASTER_PROJECT})
option(TEAKRA_RUN_TESTS "Run Teakra accuracy tests" OFF)

# Set hard requirements for C++
Expand Down Expand Up @@ -83,4 +84,6 @@ add_subdirectory(externals)
add_subdirectory(src)

# Teakra tests
add_subdirectory(tests)
if (TEAKRA_BUILD_UNIT_TESTS)
add_subdirectory(tests)
endif()
8 changes: 5 additions & 3 deletions externals/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_library(catch INTERFACE)
target_include_directories(catch INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/catch>)
if (TEAKRA_BUILD_UNIT_TESTS)
add_library(catch INTERFACE)
target_include_directories(catch INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/catch>)
endif()

0 comments on commit ce80ae4

Please sign in to comment.