FEniCS / basix

FEniCSx finite element basis evaluation library
https://fenicsproject.org
MIT License
90 stars 34 forks source link

Switch back to C++20 and use modern set_compile_features to set minimum C++ standard #844

Closed spraetor closed 4 months ago

spraetor commented 4 months ago

Summary

When building basix as a a library to be used by other projects, it needs to communicate its c++ standard requirements, especially now since c++23 is required to some extend. Currently the library is configured by setting the global cmake variable CMAKE_CXX_STANDARD etc. This works perfectly fine for this library, but is not included in the exported targets. With the current PR the way of enforcing the c++ standard is changed to a compile feature cxx_std_23 set directly on the basix target. This way it is included in the exported target.

garth-wells commented 4 months ago

We “dropped” some std ranges code in to test. Which of what was added is C++23?

I’m not sure we want to move to C++23 yet.

jhale commented 4 months ago

Thanks @spraetor I didn't know this was possible - we should make this change after discussing whether to use C++23 or C++20 mode.