aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenry Schreiner <HenrySchreinerIII@gmail.com>2021-01-19 18:49:03 -0500
committerGitHub <noreply@github.com>2021-01-19 18:49:03 -0500
commit130c99544d5b622ed5304886d0bcb2e07e6f8451 (patch)
tree537f140f3956d2b2bd953578c08a752e1392416c /tests
parenteb83feefff14e6b805e46b795b133f2523d0d585 (diff)
downloadplatform_external_python_pybind11-130c99544d5b622ed5304886d0bcb2e07e6f8451.tar.gz
platform_external_python_pybind11-130c99544d5b622ed5304886d0bcb2e07e6f8451.tar.bz2
platform_external_python_pybind11-130c99544d5b622ed5304886d0bcb2e07e6f8451.zip
fix: support basic dual includes (#2804)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmake_build/CMakeLists.txt5
-rw-r--r--tests/test_cmake_build/subdirectory_embed/CMakeLists.txt4
-rw-r--r--tests/test_cmake_build/subdirectory_function/CMakeLists.txt2
-rw-r--r--tests/test_cmake_build/subdirectory_target/CMakeLists.txt2
4 files changed, 8 insertions, 5 deletions
diff --git a/tests/test_cmake_build/CMakeLists.txt b/tests/test_cmake_build/CMakeLists.txt
index cd39b0b..8bfaa38 100644
--- a/tests/test_cmake_build/CMakeLists.txt
+++ b/tests/test_cmake_build/CMakeLists.txt
@@ -25,7 +25,7 @@ function(pybind11_add_build_test name)
endif()
if(NOT ARG_INSTALL)
- list(APPEND build_options "-DPYBIND11_PROJECT_DIR=${pybind11_SOURCE_DIR}")
+ list(APPEND build_options "-Dpybind11_SOURCE_DIR=${pybind11_SOURCE_DIR}")
else()
list(APPEND build_options "-DCMAKE_PREFIX_PATH=${pybind11_BINARY_DIR}/mock_install")
endif()
@@ -79,3 +79,6 @@ if(PYBIND11_INSTALL)
endif()
add_dependencies(check test_cmake_build)
+
+add_subdirectory(subdirectory_target EXCLUDE_FROM_ALL)
+add_subdirectory(subdirectory_embed EXCLUDE_FROM_ALL)
diff --git a/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt b/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
index c7df0cf..dfb9cb8 100644
--- a/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
+++ b/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
@@ -16,7 +16,7 @@ set(PYBIND11_INSTALL
CACHE BOOL "")
set(PYBIND11_EXPORT_NAME test_export)
-add_subdirectory(${PYBIND11_PROJECT_DIR} pybind11)
+add_subdirectory("${pybind11_SOURCE_DIR}" pybind11)
# Test basic target functionality
add_executable(test_subdirectory_embed ../embed.cpp)
@@ -24,7 +24,7 @@ target_link_libraries(test_subdirectory_embed PRIVATE pybind11::embed)
set_target_properties(test_subdirectory_embed PROPERTIES OUTPUT_NAME test_cmake_build)
add_custom_target(check_subdirectory_embed $<TARGET_FILE:test_subdirectory_embed>
- ${PROJECT_SOURCE_DIR}/../test.py)
+ "${PROJECT_SOURCE_DIR}/../test.py")
# Test custom export group -- PYBIND11_EXPORT_NAME
add_library(test_embed_lib ../embed.cpp)
diff --git a/tests/test_cmake_build/subdirectory_function/CMakeLists.txt b/tests/test_cmake_build/subdirectory_function/CMakeLists.txt
index 624c600..34aedcf 100644
--- a/tests/test_cmake_build/subdirectory_function/CMakeLists.txt
+++ b/tests/test_cmake_build/subdirectory_function/CMakeLists.txt
@@ -11,7 +11,7 @@ endif()
project(test_subdirectory_function CXX)
-add_subdirectory("${PYBIND11_PROJECT_DIR}" pybind11)
+add_subdirectory("${pybind11_SOURCE_DIR}" pybind11)
pybind11_add_module(test_subdirectory_function ../main.cpp)
set_target_properties(test_subdirectory_function PROPERTIES OUTPUT_NAME test_cmake_build)
diff --git a/tests/test_cmake_build/subdirectory_target/CMakeLists.txt b/tests/test_cmake_build/subdirectory_target/CMakeLists.txt
index 2471941..31d862f 100644
--- a/tests/test_cmake_build/subdirectory_target/CMakeLists.txt
+++ b/tests/test_cmake_build/subdirectory_target/CMakeLists.txt
@@ -11,7 +11,7 @@ endif()
project(test_subdirectory_target CXX)
-add_subdirectory(${PYBIND11_PROJECT_DIR} pybind11)
+add_subdirectory("${pybind11_SOURCE_DIR}" pybind11)
add_library(test_subdirectory_target MODULE ../main.cpp)
set_target_properties(test_subdirectory_target PROPERTIES OUTPUT_NAME test_cmake_build)