mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Apply c++ standard flag only to files of CXX language. (#1678)
This commit is contained in:
parent
77ef03d5b1
commit
868d94fcb4
@ -90,7 +90,11 @@ if(NOT TARGET ${PN}::pybind11)
|
|||||||
set_property(TARGET ${PN}::module APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${PYTHON_LIBRARIES})
|
set_property(TARGET ${PN}::module APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${PYTHON_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
set_property(TARGET ${PN}::pybind11 APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "${PYBIND11_CPP_STANDARD}")
|
set_property(TARGET ${PN}::pybind11 APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "${PYBIND11_CPP_STANDARD}")
|
||||||
|
else()
|
||||||
|
set_property(TARGET ${PN}::pybind11 APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CXX>:${PYBIND11_CPP_STANDARD}>)
|
||||||
|
endif()
|
||||||
|
|
||||||
get_property(_iid TARGET ${PN}::pybind11 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(_iid TARGET ${PN}::pybind11 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(_ill TARGET ${PN}::module PROPERTY INTERFACE_LINK_LIBRARIES)
|
get_property(_ill TARGET ${PN}::module PROPERTY INTERFACE_LINK_LIBRARIES)
|
||||||
|
@ -185,7 +185,11 @@ function(pybind11_add_module target_name)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Make sure C++11/14 are enabled
|
# Make sure C++11/14 are enabled
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
target_compile_options(${target_name} PUBLIC ${PYBIND11_CPP_STANDARD})
|
target_compile_options(${target_name} PUBLIC ${PYBIND11_CPP_STANDARD})
|
||||||
|
else()
|
||||||
|
target_compile_options(${target_name} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${PYBIND11_CPP_STANDARD}>)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ARG_NO_EXTRAS)
|
if(ARG_NO_EXTRAS)
|
||||||
return()
|
return()
|
||||||
|
Loading…
Reference in New Issue
Block a user