This is an archive of the discontinued LLVM Phabricator instance.

[libc] Set default CXX_STANDARD to C++17 and let targets set their own standard if needed.
ClosedPublic

Authored by lntue on Feb 2 2022, 9:07 PM.

Details

Summary

CMAKE_CXX_STANDARD 14 is set in the llvm-project/llvm folder overriding all COMPILE_OPTIONS -std=c++17. We need to override the CXX_STANDARD property of the target in order to set the correct C++ standard flags.

Diff Detail

Event Timeline

lntue created this revision.Feb 2 2022, 9:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 9:07 PM
lntue requested review of this revision.Feb 2 2022, 9:07 PM

If you a need a c++17 compliant compiler to build libm, should we just set it for all of libc? Looks like flang already does this.

lntue added a comment.Feb 3 2022, 8:18 AM

If you a need a c++17 compliant compiler to build libm, should we just set it for all of libc? Looks like flang already does this.

If you a need a c++17 compliant compiler to build libm, should we just set it for all of libc? Looks like flang already does this.

That sounds good to me if @sivachandra is fine with pushing the whole libc to C++17.

lntue updated this revision to Diff 405860.Feb 3 2022, 7:51 PM

Set default CXX_STANDARD to C++17.

lntue retitled this revision from [libc] Properly setting -std=c++17 for targets that requires C++17. to [libc] Set default CXX_STANDARD to C++17 and let targets set their own standard if needed..Feb 3 2022, 7:54 PM
lntue added a reviewer: abrachet.
gchatelet accepted this revision.Feb 4 2022, 6:53 AM

Thx! Wait for @sivachandra before submitting.

This revision is now accepted and ready to land.Feb 4 2022, 6:53 AM