mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
test: fix warning/error on Python 2 in 14/17 mode
This commit is contained in:
parent
3d20b73e87
commit
49007b7ff3
@ -151,6 +151,14 @@ function(pybind11_enable_warnings target_name)
|
||||
target_compile_options(${target_name} PRIVATE -Werror)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND PYTHON_VERSION VERSION_LESS 3.0)
|
||||
if(CMAKE_CXX_STANDARD STREQUAL "14")
|
||||
target_compile_options(${target_name} PUBLIC -Wno-deprecated-register)
|
||||
elseif(NOT CMAKE_CXX_STANDARD VERSION_LESS 17)
|
||||
target_compile_options(${target_name} PUBLIC -Wno-register)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set(test_targets pybind11_tests)
|
||||
|
Loading…
Reference in New Issue
Block a user