Skip to content

Commit 63c72da

Browse files
committed
Set output directory for test to make windows happy
1 parent fc8c176 commit 63c72da

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/CMakeLists.txt

+12-3
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,18 @@ add_custom_target(
563563
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
564564
USES_TERMINAL)
565565

566-
# This module doesn't get mixed with other test modules because those aren't subinterpreter safe.
567-
pybind11_add_module(mod_test_interpreters THIN_LTO mod_test_interpreters.cpp)
568-
add_dependencies(pytest mod_test_interpreters)
566+
if(NOT PYBIND11_CUDA_TESTS)
567+
# This module doesn't get mixed with other test modules because those aren't subinterpreter safe.
568+
pybind11_add_module(mod_test_interpreters THIN_LTO mod_test_interpreters.cpp)
569+
set_target_properties(mod_test_interpreters PROPERTIES LIBRARY_OUTPUT_DIRECTORY
570+
"${CMAKE_CURRENT_BINARY_DIR}")
571+
foreach(config ${CMAKE_CONFIGURATION_TYPES})
572+
string(TOUPPER ${config} config)
573+
set_target_properties(mod_test_interpreters PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${config}
574+
"${CMAKE_CURRENT_BINARY_DIR}")
575+
endforeach()
576+
add_dependencies(pytest mod_test_interpreters)
577+
endif()
569578

570579
if(PYBIND11_TEST_OVERRIDE)
571580
add_custom_command(

0 commit comments

Comments
 (0)