Disable testing when using BUILD_TESTING (#1682)

This commit is contained in:
Paul Fultz II 2020-08-18 07:34:18 -05:00 committed by GitHub
parent cf0a64596e
commit 69821d9e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,6 +272,13 @@ if(PYBIND11_INSTALL)
endif()
endif()
if(PYBIND11_TEST OR (BUILD_TESTING AND PYBIND11_MASTER_PROJECT))
# 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()