Skip to content

Commit

Permalink
Disable testing when using BUILD_TESTING (#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 authored Aug 18, 2020
1 parent cf0a645 commit 69821d9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ if(PYBIND11_INSTALL)
endif()
endif()

if(PYBIND11_TEST OR (BUILD_TESTING AND PYBIND11_MASTER_PROJECT))
add_subdirectory(tests)
# BUILD_TESTING takes priority, but only if this is the master project
if(PYBIND11_MASTER_PROJECT AND DEFINED BUILD_TESTING)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
else()
if(PYBIND11_TEST)
add_subdirectory(tests)
endif()
endif()

0 comments on commit 69821d9

Please sign in to comment.