Commit Graph

22 Commits

Author SHA1 Message Date
Raul Tambre
e47dfce75d CMP0128: Enable/disable extensions if standard same as default
This was intended to be part of the initial MR (!6177), but accidentally went
missing when debugging nightly failures on less common systems. Noticed during
!6711 review as the comment about this behaviour didn't match the code.

Documentation for CMP0128 is updated to remove a false case and note the two
cases related to this.

Fixes #22224.
2021-11-11 21:55:04 +02:00
Raul Tambre
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128.

When the standard level is unset:
* Flags are added if extension mode doesn't match the compiler's default.
  Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224.
* The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was
  used. This was only supported for IAR.

Otherwise:
* Avoid adding flags if not necessary per the detected compiler defaults.
* Fixed check for when the requested standard is older. It now matches the
  nearby comments.

I reworded the fallback comment as its logic was a bit difficult to wrap my
head around.
2021-09-29 22:28:40 +03:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
361b1ea4c7 Refactor: cmStandardLevelResolver::ComputeFeaturesAvailable returns cmProp 2021-08-12 19:17:35 +02:00
Jaak Ristioja
8d5052fdc4 cmStandardLevelResolver: Fixed typo in struct name + clang-format 2021-07-31 15:12:27 +03:00
Robert Maynard
a3cafa4237 compile_features: Ignore features that map to languages that aren't enabled
Remove the Cuda/ConsumeCompileFeatures test as it only existed to
validate that using `cxx_std_XY` would cause the paired language (CUDA) to also build in mode XY.
2021-06-25 13:39:50 -04:00
Gregor Jasny
e8dc95ae1e ObjectiveC: Add C17 and C23 support
Issue: #22297
2021-06-11 14:47:23 +02:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Brad King
410bf8ed4f cmStandardLevelResolver: Fix size assertion in constructor
Assert sizes of the constructed vectors, not the moved-from inputs.
2021-06-03 14:59:55 -04:00
Vitaly Stakhovsky
ce97b7909b Source: Remove unnecessary comparisons to nullptr 2021-05-10 11:44:53 -04:00
Raul Tambre
dcd599757f C23 support 2021-02-25 18:22:10 +02:00
Raul Tambre
93b7d3d292 C17 support
Implements #17755.
2021-02-25 18:22:10 +02:00
Brad King
533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions 2021-01-05 09:29:18 -05:00
Raul Tambre
9f3c70a333 CUDA, CXX, OBJCXX: C++23 support with Clang 12
Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b
in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
2020-12-08 18:43:59 +02:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Brad King
4662c041ea Merge topic 'move_more_queries_to_cmStandardLevelResolver'
56cf509a72 Move AddCompilerRequirementFlag to cmStandardLevelResolver

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4989
2020-07-16 10:17:52 -04:00
Robert Maynard
56cf509a72 Move AddCompilerRequirementFlag to cmStandardLevelResolver
The cmLocalGenerator::AddCompilerRequirementFlag was another
source of truth on what standard levels existed per language,
so fold that into cmStandardLevelResolver to make updating
CMake easier
2020-07-15 09:40:33 -04:00
Vitaly Stakhovsky
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string 2020-07-14 15:18:59 -04:00
Justin Goshi
2f383d852d fileapi: Support multiple backtraces for language standard 2020-07-06 11:40:39 -07:00
Robert Maynard
49f3e0ab6f cmStandardLevelResolver: Refactor to remove duplicate code
This will make it easier to add new languages that have standard flags.
2020-07-03 07:37:45 -04:00
Robert Maynard
dc94b0249e cmStandardLevelResolver: Added to handle standard level queries
Refactored out of cmMakefile
2020-07-01 07:58:58 -04:00