We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e14480 commit 3e2d0b7Copy full SHA for 3e2d0b7
tests/CMakeLists.txt
@@ -227,6 +227,18 @@ foreach(target ${test_targets})
227
pybind11_add_module(${target} THIN_LTO ${target}.cpp ${test_files} ${PYBIND11_HEADERS})
228
pybind11_enable_warnings(${target})
229
230
+ if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
231
+ get_property(
232
+ suffix
233
+ TARGET ${target}
234
+ PROPERTY SUFFIX)
235
+ set(source_output "${CMAKE_CURRENT_SOURCE_DIR}/${target}${suffix}")
236
+ if(suffix AND EXISTS "${source_output}")
237
+ message(WARNING "Output file also in source directory; "
238
+ "please remove to avoid confusion: ${source_output}")
239
+ endif()
240
241
+
242
if(MSVC)
243
target_compile_options(${target} PRIVATE /utf-8)
244
endif()
0 commit comments