Page MenuHome

CMake: Use CMake to select C++ standard
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Jul 12 2021, 5:30 PM.

Details

Summary

We managed the compiler flags our selves
which although allowed, not really needed
CMake has had this option since 3.1.

Also unsure if this is something just
broken in the nightly cmake or this is a
preview of things to come in 3.21/22 but:

When you don't initialize this property it
seems to default to c++14 causing it to pass
both /std:c++17 and /std:c++14 which makes
the MSVC compiler override our C++17 switch
with CMakes C++14 switch leading to build
errors.

Diff Detail

Repository
rB Blender
Branch
tmp_cxx17 (branched from master)
Build Status
Buildable 15795
Build 15795: arc lint + arc unit

Event Timeline

Ray Molenkamp (LazyDodo) requested review of this revision.Jul 12 2021, 5:30 PM
Ray Molenkamp (LazyDodo) created this revision.
This revision is now accepted and ready to land.Jul 13 2021, 4:07 PM

When you don't initialize this property it seems to default to c++14 causing it to pass both /std:c++17 and /std:c++14 which makes the MSVC compiler override our C++17 switch with CMakes C++14 switch leading to build errors.

Accepting under the assumption this _is_ being initialized properly.

CMakeLists.txt
1710

It would be good to include a one liner for why this is needed.

  • Merge remote-tracking branch 'origin/master' into tmp_cxx17
  • Add comments

The way the diff got split in side by side view, It wasn't quite clear what you wanted a comment on, so I left a comment on 3, is this more or less what you were looking for?

  • fix accidentally removed comment regarding msvc