-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Hardcoding CMAKE_CXX_STANDARD
breaks source-consuming downstream projects using target_compile_features
#3189
Comments
|
The |
https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD The value |
I suggest replacing |
What platforms are you supporting that are still limited to CMake version 3.1? That's quite old at this point. It may be worth it to let such users stick to the current release so that we can improve the experience for the majority of users who are using ~3.10 or newer. Here's a convenient table showing what platforms ship what version of CMake: https://alexreinking.com/blog/how-to-use-cmake-without-the-agonizing-pain-part-1.html In short, the oldest version still in regular use is CMake 3.16 on Ubuntu 20.04 LTS but if you want to go back to Ubuntu 18.04 LTS which is nearing EOL, that still has CMake 3.10. |
It's more about the question whether we need to bump the version rather than supporting some specific platform. Anyway, 3.8 is quite old version so it's probably OK to bump it if it makes things significantly simpler. |
https://github.com/ChrisThrasher/fmt/commit/daf0c44be7b4b5768e5892c46af5b347303321d4 Here's what I had in mind. Please correct me if C++11 is not in fact the minimum language standard. |
@ChrisThrasher |
See PR #3205 |
fmt/support/cmake/cxx14.cmake
Lines 10 to 12 in a935ac3
For project consuming the latest release of fmt via
add_subdirectory
like seen here who also use the moderntarget_compile_features
-based approach to enable a specific language standard like C++17 have their builds broken by the above snippet. The above snippet can result in their requested language standard being overridden by the default language standard used in fmt unless they're careful to setCMAKE_CXX_STANDARD
themselves before including fmt.I see this is likely the case because the library claims to support CMake versions all the way back to 3.1, well before
target_compile_features
was added. Can the minimum version be raised to usetarget_compile_features
or can we at least add some extra CMake code to us the modern language specification functions when possible?The text was updated successfully, but these errors were encountered: