Skip to content

Commit d4238c4

Browse files
committed
fix: typo for warning on C++17, support Win + 2.7
1 parent e6063b3 commit d4238c4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ jobs:
118118
shell: bash
119119
run: >
120120
cmake -S . -B build2
121-
-DPYBIND17_WERROR=ON
121+
-DPYBIND11_WERROR=ON
122122
-DDOWNLOAD_CATCH=ON
123123
-DDOWNLOAD_EIGEN=ON
124124
-DCMAKE_CXX_STANDARD=${{ matrix.max-cxx-std }}
125125
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
126126
127127
- name: Build C++${{ matrix.max-cxx-std }}
128-
run: cmake --build build2 -j 2
128+
run: cmake --build build2 -j 2 -v
129129

130130
- name: Python tests C++${{ matrix.max-cxx-std }}
131131
run: cmake --build build2 --target pytest

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,15 @@ endif()
181181

182182
message(STATUS "CXX Compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
183183

184+
# Workaround for Python 2.7 and C++17 (C++14 as a warning) incompatibility
184185
set(clang_4plus
185186
"$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,3.9>>>")
186187
set(no_register "$<OR:${clang_4plus},$<CXX_COMPILER_ID:AppleClang>>")
187-
target_compile_options(pybind11
188-
INTERFACE "$<${no_register}:-Wno-register;-Wno-deprecated-register>")
188+
set(cxx_no_register "$<AND:$<COMPILE_LANGUAGE:language>,${no_register}>")
189+
set(msvc "$<CXX_COMPILER_ID:MSVC>")
190+
target_compile_options(
191+
pybind11 INTERFACE "$<${cxx_no_register}:-Wno-register;-Wno-deprecated-register>"
192+
"$<${msvc}:/wd5033>")
189193

190194
add_library(embed INTERFACE)
191195
add_library(pybind11::embed ALIAS embed)

0 commit comments

Comments
 (0)