-
Notifications
You must be signed in to change notification settings - Fork 34
CMakeLists.txt: Require C++11 and cmake 3.7 #653
CMakeLists.txt: Require C++11 and cmake 3.7 #653
Conversation
|
+1 for this PR, but I'm not sure what is the purpose of checking for relaxed |
|
@mliszcz My idea is that we only use |
bourtemb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for this PR too!
Thanks @t-b for the initiative.
Please check my minor review comments.
|
Indentation is fixed. |
b9479d8 to
1f8c2c8
Compare
|
@mliszcz @bourtemb Ready for review. I've not done any automated modernization using clang-tidy/clang-modernize at this point as the PR is already big enough. And I also did not want to step on everyones toes who has a PR open. |
I think |
|
I'm not 100% sure that |
bourtemb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @t-b for this big PR cleaning up the current code after the decision taken to require C++11 support.
This PR looks good to me as it is now.
It has an impact on a big number of files so this will cause some issues with the other PRs currently being merged which will have to be rebased and conflicts may appear.
I think we should not wait too much before merging this one because it will become quickly a nightmare to keep it up to date otherwise.
|
@t-b Thanks! I've merged the mentioned PR. There is a minor conflict in travis configuration though. |
mliszcz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
We don't use per target properties like cxx_std_11 as these are only supported starting with cmake 3.8. So we set it globally instead.
This is way too old to work anymore as we now require C++11.
We now require C++11. Done with unifdef -DHAS_UNIQUE_PTR
We now require C++11. Done with unifdef -DHAS_MAP_AT
We now require C++11. Done with unifdef -DHAS_OVERRIDE
We now require C++11. Done with unifdef -DHAS_RVALUE
We now require C++11. Done with unifdef -DHAS_THREAD
We now require C++11. Done with unifdef -DHAS_TYPE_TRAITS
We now require C++11. Done with unifdef -DHAS_LAMBDA_FUNC
We now always require C++11.
We now require C++11 so nullptr is always available. But we keep the definitions of Tango_nullptr for backwards compatibility.
We now require C++11. Done with unifdef -DHAS_RANGE_BASE_FOR
We now require C++11. Done with unifdef -DINIT_LIST
We now require C++11. Done with unifdef -DHAS_UNDERLYING
We now always require C++11.
…feature checking We now always require C++11.
This is just too old as it has only GCC 4.7.2.
Exposed with the new C++11 compilation, but ultimately forgotten in cc8f943 (cppapi/server: Ignore warnings for generated code, 2019-11-15).
Found with -Winconsistent-missing-override using latest clang 9.0.
We don't support GCC < 4 anymore.
The only C++ feature we are currently using which is not supported by C++11 is C++14 relaxed constexpr. Instead of using the old school ifdef magic we now use a real feature test. This also requires to move the definition of TANGO_CONSTEXPR to tango_const.h.in.
We now output cmake/compiler and platform versions for easier debugging. Output like the CMAKE_BUILD_TYPE was also changed to be outputted always regardless if default or not.
MSVC versions prior to VS 2015 (aka msvc14) don't have usable C++11 support. So we can't build on those anymore. This was also decided in [2] which said: > Decision was taken to stop support for MSVC9, MSVC10 and MSVC12. The > builds for these MSVC compiler versions will be removed from appveyor. > If some users still need to compile cppTango using these compilers, they > will need to fork cppTango and maintain a version compatible with these > old compilers. [1]: https://docs.microsoft.com/en-us/previous-versions/hh567368(v=vs.140)?redirectedfrom=MSDN#featurelist [2]: https://github.com/tango-controls/tango-kernel-followup/blob/master/2019-02-04/outcomes.md
Removed with unifdef -D_MSC_VER=1900 and manual fixup of false matches. We also remove the predefined WIN32_VC* definitions as nobody is using them.
Support for MSVC below 2015 (aka vc14 aka _MSC_VER 1900) was removed in a previous commit.
We nowadays alwas mark Except::throw_exception as [[noreturn]] therefore all compiler should be able to figure out that the function does not need a return value here.
100f45f to
17abaed
Compare
cxx_relaxed_constexpr, see also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html#prop_gbl:CMAKE_CXX_KNOWN_FEATURESCloses #626.