-
Notifications
You must be signed in to change notification settings - Fork 46
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
don't allow CMAKE_CXX_STANDARD #342
Conversation
And what's the alternative? |
use validate() to raise if the standard is too low |
please, add it to the hook message |
OKay, it's an error message, so it will break Conan Center if merged. There are 2 options, fix all recipes or downgrade to warning level. |
I'm ready to do all the pull requests to fix recipes before this one is merged, if we agree on the principle |
Patch upstream CMakeLists to add |
AFAIU, |
CMake uses both CXX_STANDARD and cxx features to know which C++ standard to inject. |
I think that more than 1% of the packages are affected by this problem, but I don't have yet precise figures. Is there somewhere a list of the most downloaded packages on CCI, so that I can go check the sources of the matching project ? Until now we now that at least gtest, fmt and asio have this problem of api/abi changing with cppstd. |
systemc is also an offender. |
Just to clarify:
|
sorry for repeating, but there are at least two improvements:
|
I'm using quite often apple-clang without compiler.cppstd set, and never had cryptic error. It just works for the vast majority of recipes, and I can use pre-build packages. Here you'll prevent to build all packages requiring C++11 or higher (sometimes only at build time by the way, not consume time, it depends) on Macos in CI of CCI. It also means that they won't even be tested on Macos. |
For cryptic error message example, please see conan-io/conan-center-index#7236 (comment) EDIT: this one is far less cryptic than what I remember. It is probably worse with C++14 or c++17 packages EDIT2: I attached an example of the error you get if you consume qt6 without defining cppstd and CXX_STANDARD: errorMessage.txt |
This is IMHO the biggest problem we have now in ConanCenter. But the issue comes not only from our When I think about this issue I usually come back to this: conan-io/examples#73. If I think in terms of CCI, it would easy to fix it if we run the builds for all the different I'll follow this thread with interest. |
The main issue the last time we discussed it was that you can't simply rely on compatible_packages (the POC of a function that extends If someone uses Boost (in their public interfaces) - it's no longer possible for the to mix C++14 and C++17 in the same TU. A solution requires native Conan support. |
Forcing CMAKE_CXX_STANDARD in a cmakelists overrides conan setting compiler.cppstd, so it creates an incoherent graph when consuming recipe. there are currently 64 offending recipes: https://github.com/conan-io/conan-center-index/search?l=CMake&q=CMAKE_CXX_STANDARD