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

Fix compilation when using CMake 3.26.1 and pybind11 2.4.3 (for example on Ubuntu 20.04 GitHub Actions image) #643

Merged
merged 1 commit into from
Apr 2, 2023

Conversation

traversaro
Copy link
Collaborator

Fix #636 .

This PR fixes an issue when using CMake 3.26.1 (so a quite recent CMake) with pybind11 2.4.3 (quite an old version).

Basically, the problem is that the old version of pybind11 explicitly sets -std=c++14 as compilation option, and this overrides the -std=c++17 option that should be used instead (see https://github.com/pybind/pybind11/blob/v2.4.3/tools/pybind11Tools.cmake#L21 and https://github.com/pybind/pybind11/blob/v2.4.3/tools/pybind11Tools.cmake#L21). By explicitingly setting the CMAKE_CXX_STANDARD option, we make sure that pybind11 does not set any additional option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failure in ubuntu 20.04-apt March 2023
2 participants