fix: typo for warning on C++17, support Win + 2.7

This commit is contained in:
Henry Schreiner 2020-07-29 20:10:38 -04:00 committed by Henry Schreiner
parent 1b92cd1703
commit f64d5aa6da
2 changed files with 8 additions and 3 deletions

View File

@ -118,14 +118,14 @@ jobs:
shell: bash shell: bash
run: > run: >
cmake -S . -B build2 cmake -S . -B build2
-DPYBIND17_WERROR=ON -DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON -DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON -DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=${{ matrix.max-cxx-std }} -DCMAKE_CXX_STANDARD=${{ matrix.max-cxx-std }}
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
- name: Build C++${{ matrix.max-cxx-std }} - name: Build C++${{ matrix.max-cxx-std }}
run: cmake --build build2 -j 2 run: cmake --build build2 -j 2 -v
- name: Python tests C++${{ matrix.max-cxx-std }} - name: Python tests C++${{ matrix.max-cxx-std }}
run: cmake --build build2 --target pytest run: cmake --build build2 --target pytest

View File

@ -176,9 +176,14 @@ endif()
message(STATUS "CXX Compiler version: ${CMAKE_CXX_COMPILER_VERSION}") message(STATUS "CXX Compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
# Workaround for Python 2.7 and C++17 (C++14 as a warning) incompatibility
set(clang_4plus "$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,3.9>>>") set(clang_4plus "$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,3.9>>>")
set(no_register "$<OR:${clang_4plus},$<CXX_COMPILER_ID:AppleClang>>") set(no_register "$<OR:${clang_4plus},$<CXX_COMPILER_ID:AppleClang>>")
target_compile_options(pybind11 INTERFACE "$<${no_register}:-Wno-register;-Wno-deprecated-register>") set(cxx_no_register "$<AND:$<COMPILE_LANGUAGE:CXX>,${no_register}>")
set(msvc "$<CXX_COMPILER_ID:MSVC>")
target_compile_options(
pybind11 INTERFACE "$<${cxx_no_register}:-Wno-register;-Wno-deprecated-register>"
"$<${msvc}:/wd5033>")
add_library(embed INTERFACE) add_library(embed INTERFACE)
add_library(pybind11::embed ALIAS embed) add_library(pybind11::embed ALIAS embed)