Revert "buildsystem: relax requirement on cmake version" - #1440
yann-morin-1998 wants to merge 1 commit into
Conversation
In e8b6b7a, we relaxed the cmake version check down to 3.1, the first version to expose target_compile_features(). However, an error while testing that change improperly concluded that the change was OK. While target_compile_features() was indeed introduced in cmake 3.1, the actual feature we use it to test, cxx_std_11, was really introduced only with cmake-3.8, which explained the actual version that was requested before e8b6b7a. Coming up with a working test is not as trivial as initially thought, so a better solution will have to be devised in the future. In the mean time, revert to the previously-working situation. This reverts commit e8b6b7a. Reported-by: Patrick Boettcher <patrick.boettcher@posteo.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
As I wrote in #1441 (comment):
Does this make sense? |
|
@nlohmann , the first two bullet points in your response are exactly what I implemented under #1441, however as @pboettch noted this is quite a big difference, to quote from the comment:
Update; See comment below, it only overwrites the implicitly set version by the compiler. |
|
I made a test of all of this. And believe we were incorrect in our assumption that With gcc 7.3, the default C++ version is 14, which means that if you pass no flags that explicitly specify the version you get C++14. If a transitive dependency sets That means that if downstream projects from this rely on the implicit assumption their compiler will use Based on this I do again believe that #1441 is an appropriate fix for this. |
|
@iwanders are you sure about your tests? I used And it is transitive to downstream targets if and only if declared as PUBLIC: target_compile_features(<tgt> PUBLIC cxx_std_11) if declared as PRIVATE nothing happens. |
|
@pboettch , I linked the test in the previous comment. I could have been more clear though in my comment. With So yes, setting |
|
OK, I see. Totally agree now. Downstream projects need to set their modern c++-standard explicitly otherwise they don't know which version they use. If they don't set it, they don't care, thus this library can impose a standard. Great. Thanks for insisting. Can you re-open your PR. I'll approve it. @nlohmann could merge it, IMHO. |
Yes, definitely.
No problem :) I've reopened the PR based on this discussion. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Fixed with #1441. |
In e8b6b7a, we relaxed the cmake version check down to 3.1, the first
version to expose target_compile_features().
However, an error while testing that change improperly concluded that
the change was OK. While target_compile_features() was indeed introduced
in cmake 3.1, the actual feature we use it to test, cxx_std_11, was
really introduced only with cmake-3.8, which explained the actual
version that was requested before e8b6b7a.
Coming up with a working test is not as trivial as initially thought, so
a better solution will have to be devised in the future. In the mean
time, revert to the previously-working situation.
This reverts commit e8b6b7a.
Reported-by: Patrick Boettcher patrick.boettcher@posteo.de
Signed-off-by: "Yann E. MORIN" yann.morin.1998@free.fr