Skip to content

Commit

Permalink
fix: typo for warning on C++17, support Win + 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Jul 30, 2020
1 parent e6063b3 commit d4238c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,15 @@ 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
"$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,3.9>>>")
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:language>,${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(pybind11::embed ALIAS embed)
Expand Down

0 comments on commit d4238c4

Please sign in to comment.