From f64d5aa6da17ef92987a0b740f94c5d8cbce3229 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 29 Jul 2020 20:10:38 -0400 Subject: [PATCH] fix: typo for warning on C++17, support Win + 2.7 --- .github/workflows/ci.yml | 4 ++-- CMakeLists.txt | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf0879db1..b51b0c630 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,14 +118,14 @@ jobs: shell: bash run: > cmake -S . -B build2 - -DPYBIND17_WERROR=ON + -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_STANDARD=${{ matrix.max-cxx-std }} -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") - 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 }} run: cmake --build build2 --target pytest diff --git a/CMakeLists.txt b/CMakeLists.txt index 2227559da..0337f0b03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,9 +176,14 @@ endif() 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 "$,$,3.9>>>") set(no_register "$>") -target_compile_options(pybind11 INTERFACE "$<${no_register}:-Wno-register;-Wno-deprecated-register>") +set(cxx_no_register "$,${no_register}>") +set(msvc "$") +target_compile_options( + pybind11 INTERFACE "$<${cxx_no_register}:-Wno-register;-Wno-deprecated-register>" + "$<${msvc}:/wd5033>") add_library(embed INTERFACE) add_library(pybind11::embed ALIAS embed)