1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-20 19:55:10 +08:00

41 Commits

Author SHA1 Message Date
Ben Boeckel
7aa1e45e56 cmStandardLevelResolver: offer an API to get the string of a level 2024-04-11 10:19:44 -04:00
Vitaly Stakhovsky
1a49b439a5 Source: Use cmValue::IsOn and IsOff
Speed up a bit by calling members directly.
2024-03-17 19:05:37 -04:00
Brad King
c1f1aedcee cmStandardLevelResolver: Add method to look up standard level by name 2023-10-04 18:44:44 -04:00
Brad King
23b57462aa cmStandardLevelResolver: Report feature std level from GetNewRequiredStandard
Regardless of whether the feature requires a new (higher) standard
level, always report the standard level that the feature needs.
2023-10-04 18:44:18 -04:00
Brad King
7519001ae6 cmStandardLevelResolver: Add method to get feature standard level 2023-10-04 18:15:04 -04:00
Brad King
99fa01d3fa cmStandardLevelResolver: Factor out public representation of level 2023-10-04 17:14:58 -04:00
Brad King
fdd81a609a cmStandardLevelResolver: Clarify local variable name 2023-10-04 17:14:58 -04:00
Brad King
73a1d422a5 cmStandardLevelResolver: Mark builtin language standards table as const 2023-10-04 17:14:58 -04:00
Ben Boeckel
8b4d32c18b cmStandardLevelResolver: add query for the effective standard level
This allows for improved error messages.
2023-08-23 16:14:02 -04:00
Ben Boeckel
17ddc4ac76 cmStandardLevelResolver: compare with static string literals 2023-08-23 16:13:49 -04:00
Ben Boeckel
6f1dae2b01 cmStandardLevelResolver: use cmStrCat where possible 2023-08-23 16:13:49 -04:00
Ben Boeckel
0d45d40e13 cmStandardLevelResolver: use character literals where possible 2023-08-23 16:13:49 -04:00
Marc Chevrier
e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Brad King
d10cbb0590 Merge topic 'add_language_levels_for_cxx26'
f808d8afb9 CMake: Support upcoming C++26 language level

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !7601
2022-09-01 10:04:46 -04:00
Robert Maynard
f808d8afb9 CMake: Support upcoming C++26 language level 2022-08-31 13:46:18 -04:00
Brad King
52c95540b7 target_*: Fix cross-directory call backtraces
Record the call-site backtrace, not the current backtrace of the
target's directory.

Fixes: #23873
2022-08-22 15:29:43 -04:00
Brad King
d5e3b1ca1e Merge topic 'cmp0128_cuda'
ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default
b2c25de8e0 CMP0128: Avoid test code duplication
3a089cd256 CMP0128: Prefix test names with mode
e13dd52535 XL: Detect default extensions mode for legacy compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6890
2022-01-24 12:37:52 -05:00
Raul Tambre
ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default
Commit 4a0485be (cmStandardLevelResolver: Avoid unnecessary flags, fix unset
level logic, 2021-04-29) unintentionally changed the behavior by modifying the
code to match a pre-existing comment. The resulting behavior change however
matches the intentions of CMP0128, so we simply need to guard it.

Fixes #23122.
2022-01-23 23:10:28 +02:00
Robert Maynard
ec1e40af1a cmStandardLevelResolver: Better error message on unsupported language level
Fixes #23079
2022-01-11 16:03:57 -05:00
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