File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 44
44
python : ' 3.6'
45
45
args : >
46
46
-DPYBIND11_FINDPYTHON=ON
47
- -DCMAKE_CXX_FLAGS="-D_=1"
47
+ -DPYBIND11_DEFINE_UNDERSCORE=ON
48
48
- runs-on : windows-latest
49
49
python : ' 3.6'
50
50
args : >
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tools")
81
81
option (PYBIND11_WERROR "Report all warnings as errors" OFF )
82
82
option (DOWNLOAD_EIGEN "Download EIGEN (requires CMake 3.11+)" OFF )
83
83
option (PYBIND11_CUDA_TESTS "Enable building CUDA tests (requires CMake 3.12+)" OFF )
84
+ option (PYBIND11_DEFINE_UNDERSCORE "Define the underscore to make sure it is safe" OFF )
85
+
84
86
set (PYBIND11_TEST_OVERRIDE
85
87
""
86
88
CACHE STRING "Tests from ;-separated list of *.cpp files will be built instead of all tests" )
@@ -435,6 +437,9 @@ foreach(target ${test_targets})
435
437
# Create the binding library
436
438
pybind11_add_module(${target} THIN_LTO ${target} .cpp ${test_files} ${PYBIND11_HEADERS} )
437
439
pybind11_enable_warnings(${target} )
440
+ if (PYBIND11_DEFINE_UNDERSCORE)
441
+ target_compile_definitions (-D_=1)
442
+ endif ()
438
443
439
444
if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR )
440
445
get_property (
You can’t perform that action at this time.
0 commit comments