Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify C++ standard version used via CMAKE_CXX_STANDARD CMake option #2

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set(PYBIND11_CPP_STANDARD -std=c++11)
pybind11_add_module(manifpy MODULE
bindings_rn.cpp
bindings_so2.cpp
Expand All @@ -13,8 +12,10 @@ target_link_libraries(manifpy PRIVATE ${PROJECT_NAME})
# See e.g. https://pybind11.readthedocs.io/en/stable/advanced/cast/eigen.html#storage-orders
target_compile_definitions(manifpy PRIVATE EIGEN_DEFAULT_TO_ROW_MAJOR)

# Set required C++11 flag
set_property(TARGET manifpy PROPERTY CXX_STANDARD 11)
# Set C++11 as minimum version, but permit users to specify an higher version via CMAKE_CXX_STANDARD option
# We use cxx_nullptr as a proxy for cxx_std_11, that we can't use as it was introduced in CMake 3.8 and
# the minimum CMake version required by the project is 3.5
target_compile_features(manifpy PRIVATE cxx_nullptr)
set_property(TARGET manifpy PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET manifpy PROPERTY CXX_EXTENSIONS OFF)

Expand Down