1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-17 01:12:07 +08:00

239 Commits

Author SHA1 Message Date
Martin Duffy
27244a8f73 cmGeneratorExpressionNode: Fix short-circuit logic
Fix logic added by commit 634079b86d (cmGeneratorExpressionEvaluator:
Short-circuit boolean operators, 2023-09-11, v3.28.0-rc1~47^2) and
add missing test cases.

Fixes: #25412
2023-11-13 11:11:18 -05:00
Brad King
b8151299de Merge topic 'genexp-no-eval'
634079b86d cmGeneratorExpressionEvaluator: Short-circuit boolean operators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !8791
2023-09-26 09:31:42 -04:00
Martin Duffy
634079b86d cmGeneratorExpressionEvaluator: Short-circuit boolean operators 2023-09-13 18:01:14 -04:00
Brad King
4ee45988cb Merge topic 'cmList-INSERT-regression'
45ed175f08 list(INSERT): restore old behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8732
2023-08-19 08:37:09 -04:00
Marc Chevrier
45ed175f08 list(INSERT): restore old behavior
Fixes: #25191
2023-08-17 12:07:41 +02:00
Brad King
a0056a96d5 Merge topic 'genex-REMOVE_DUPLICATES-empty'
861dd60ecf Genex: Restore REMOVE_DUPLICATES preservation of empty elements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8623
2023-07-13 08:34:22 -04:00
Brad King
861dd60ecf Genex: Restore REMOVE_DUPLICATES preservation of empty elements
Refactoring in commit 72d116ee68 (GenEx: list oriented genexes use
cmList class, 2023-03-29, v3.27.0-rc1~205^2) accidentally caused
empty elements to be dropped by the `REMOVE_DUPLICATES` genex.
Fix it and add a test case.

Fixes: #25080
2023-07-12 11:49:21 -04:00
Marc Chevrier
45f17e5a85 cmList: Add container conversion to string 2023-06-22 15:44:17 +02:00
Brad King
5924630e6d Merge topic 'compile-only-genex'
c42630ee62 cmGeneratorExpressionNode: implement `COMPILE_ONLY` genex
0fb923c460 cmGeneratorExpressionNode: implement `COMPILE_ONLY` genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8411
2023-05-05 12:42:23 -04:00
Robert Maynard
c42630ee62 cmGeneratorExpressionNode: implement COMPILE_ONLY genex
This generator expression is the inverse of `LINK_ONLY` and only coveys
usage requirements for the purposes of compilation. Its intended use is
to avoid needing to export targets that do not have link usage
requirements (e.g., header-only libraries) when used by another target.

See: #15415
2023-05-04 09:39:06 -04:00
Marc Chevrier
241304190f CMake code rely on cmList class for CMake lists management (part. 2) 2023-04-29 09:54:31 +02:00
Marc Chevrier
87fe031a07 cmList class: various enhancements 2023-04-29 09:54:22 +02:00
Marc Chevrier
e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Marc Chevrier
31675964e7 GenEx LIST: list operations
Fixes: #24550, #24547
2023-04-16 12:00:20 +02:00
Ben Boeckel
0fb923c460 cmGeneratorExpressionNode: implement COMPILE_ONLY genex
This generator expression is the inverse of `LINK_ONLY` and only coveys
usage requirements for the purposes of compilation. Its intended use is
to avoid needing to export targets that do not have link usage
requirements (e.g., header-only libraries) when used by another target.

It will also be used to represent private usage requirements on exported
C++ module-containing targets in the future.

Eventually there should be logic to collapse nesting of
`$<COMPILE_ONLY>` and `$<LINK_ONLY>` when generating instances of
either. A TODO is left in the code for this case.

See: #15415
2023-04-12 10:43:48 -04:00
Marc Chevrier
72d116ee68 GenEx: list oriented genexes use cmList class
Fixes: #24654
2023-04-05 17:55:04 +02:00
Kyle Edwards
def618f1ae Merge topic 'TargetRunTimeDllDirs'
a2c9c4f202 Add test for the new TARGET_RUNTIME_DLL_PATHS genex
aa68de0a27 TARGET_RUNTIME_DLLS: minor refactoring of shared-check.cmake
2ce3d62ffb Help: add documentation for the new TARGET_RUNTIME_DLL_DIRS genex
c351dcd967 TARGET_RUNTIME_DLL_DIRS: add the new genex to cmGeneratorExpressionNode
064c3244da TARGET_RUNTIME_DLLS: fix test for this genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8247
2023-03-02 16:28:30 -05:00
Marc Chevrier
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
Fixes: #24123
2023-03-01 12:23:28 +01:00
Alexander Neundorf
c351dcd967 TARGET_RUNTIME_DLL_DIRS: add the new genex to cmGeneratorExpressionNode
This commit adds handling for a new genex TARGET_RUNTIME_DLL_DIRS to
cmGeneratorExpressionNode. It refactors the code for TARGET_RUNTIME_DLLS
a bit, so that both TARGET_RUNTIME_DLL_DIRS and TARGET_RUNTIME_DLLS
share the implementation to collect all dlls. The new genex
collects the dlls and in a final step puts all the directories
into the result variable (and makes sure there are no duplicates).
2023-02-26 16:33:16 +01:00
Marc Chevrier
e395310a21 PATH-genex: handle lists for path decomposition and transformations
Fixes: #24371
2023-02-21 19:34:43 +01:00
Neal Venditto
780b279cc6 GHS: Enable language-dependent generator expressions
Add `Green Hills MULTI` to the list of generators checked for the
`COMPILE_LANGUAGE`, `COMPILE_LANG_AND_ID`, `LINK_LANGUAGE`, and
`LINK_LANG_AND_ID` generator expressions, since these are supported by
the generator.

Fixes: #24262
2023-02-17 19:07:37 -05:00
Kyle Edwards
33e27f6ca6 <LANG>_LINKER_LAUNCHER: Allow generator expressions 2023-02-02 11:58:56 -05:00
Robert Maynard
910ada1a88 Genex: $<CONFIG:> syntax of all entries checked
Fixes #24327
2023-01-20 13:30:25 -05:00
Luis Caro Campos
e455265d72 Genex: Fix CONFIG on imported target with no explicit mapping
When evaluating the `$<CONFIG>` genex on an imported target has the
`IMPORTED_CONFIGURATIONS` property set, the current project has a config
that does not match any of those, and no explicit configuration mappings
are defined, fall back to the same configuration as `IMPORTED_LOCATION`.

Fixes: #24222
2022-12-16 09:00:34 -05:00
Brad King
e558beeef6 Merge topic 'build-local-interface-genex'
38cbf5e15b Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex
37b5c78688 cmGeneratorExpression: Refactor stripExportInterface() to use enum class

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7919
2022-11-18 09:27:35 -05:00
Kyle Edwards
38cbf5e15b Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex
Fixes: #23209
2022-11-17 09:31:27 -05:00
Brad King
8437141b53 Genex: Fix TARGET_PROPERTY lookup scope in transitive usage requirements
When `$<TARGET_PROPERTY:tgt,prop>` is used in an `INTERFACE_*` target
property for usage requirements, it may be evaluated in the context of a
dependent target in another directory.  Look up the `tgt` name in the
directory of the target whose property holds the expression so that
imported targets isolated to that directory are visible.

Fixes: #24163
2022-11-17 07:57:21 -05:00
Kyle Edwards
09d7f947d6 cmGeneratorExpression: Require cmake instance 2022-11-11 12:29:41 -05:00
Marc Chevrier
913ea78d7a Genex LINK_LIBRARY and LINK_GROUP: check supported properties
Refines check for properties supporting these genex.
Enhance error message.

Fixes: #23699
2022-07-06 16:15:43 +02:00
Ben Leadbetter
8bd98b8117 Genex: Fix TARGET_BUNDLE_DIR_NAME incorrect extension
Fix the genex from commit 997af2e1a6 (Genex: Add TARGET_BUNDLE_DIR_NAME,
2022-04-14, v3.24.0-rc1~233^2) to use the correct bundle directory
extension for each bundle type.

Fixes: #23683
2022-07-01 08:18:10 -04:00
Marc Chevrier
4d1883df11 Genex-PATH_EQUAL: path comparison
To complete issue #23498
2022-06-01 15:28:54 +02:00
Marc Chevrier
f11e66670b Genex-PATH: path handling
Fixes: #23498
2022-05-31 15:39:51 +02:00
Ben Boeckel
aa3649eb04 clang-tidy: fix performance-unnecessary-copy-initialization lints 2022-05-24 09:09:44 -04:00
Ben Leadbetter
997af2e1a6 Genex: Add TARGET_BUNDLE_DIR_NAME
Evaluate to the name of the bundle directory for a given bundle target.

Fixes: #23409
2022-04-22 09:23:46 -04:00
Hyper Nova Sun
41ba35a42b cmTarget: Add HasKnownObjectFileLocation() shorthand
Allow `cmGlobalGenerator`s to decide `HasKnownObjectFileLocation()` per given
`cmTarget`

- `cmGlobalGenerator::HasKnownObjectFileLocation()` now takes an optional `cmGeneratorTarget`
- `cmTarget::HasKnownObjectFileLocation()` added as a shorthand
2022-04-11 14:10:29 -07:00
Brad King
73337cb383 LINK_LIBRARIES: Evaluate separately for linking and usage requirements
We evaluate `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` for two purposes:

* Constructing the link line.
* Collecting usage requirements.

We evaluate `INTERFACE_LINK_LIBRARIES` separately for each purpose in
order to support the `$<LINK_ONLY:...>` generator expression used to
express private link dependencies of a static library.  Previously we
only evaluated `LINK_LIBRARIES` for linking, and used that result for
collecting usage requirements too.  Therefore `$<LINK_ONLY:...>` does
not work in `LINK_LIBRARIES`.

With the introduction of `INTERFACE_LINK_LIBRARIES_DIRECT`, evaluation
of `LINK_LIBRARIES` now needs to distinguish these two cases in order to
honor link dependencies encountered through `$<LINK_ONLY:...>` without
also exposing other usage requirements through private dependencies of a
static library.  Revise internal infrastructure to distinguish the two
cases when evaluating `LINK_LIBRARIES`.  Make the information available
in code paths for `INTERFACE_LINK_LIBRARIES_DIRECT` and `LINK_ONLY`.
Defer actually using the information to later commits.

Issue: #22496
2022-03-22 11:57:48 -04:00
Marc Chevrier
0a81ea1f12 Genex-LINK_GROUP: Add possibility to group libraries at link step
Fixes: #23121
2022-02-28 10:26:26 +01:00
Marc Chevrier
42965799b4 Genex: Add $<LINK_LIBRARY:...>
This generator expression offers the capability, for the link step, to
decorate libraries with prefix/suffix flags and/or adding any specific flag for each
library.

Fixes: #22812, #18751, #20078, #22703
2022-02-08 00:02:32 +01:00
Sean McBride
8d671dd94c Source: fix more -Wmissing-prototypes warnings 2021-10-25 12:27:10 -04:00
Sean McBride
1cf14f8c03 Source: fix many -Wmissing-prototypes warnings by marking functions static 2021-10-25 12:27:09 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
7e154ebd59 cmSystemTools::VersionCompare: use std::string for arguments 2021-09-17 11:58:46 +02:00
Marc Chevrier
361b1ea4c7 Refactor: cmStandardLevelResolver::ComputeFeaturesAvailable returns cmProp 2021-08-12 19:17:35 +02:00
Brad King
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
Since commit 2ae72ef74b (Xcode: Enable multi-arch TARGET_OBJECTS genex
in [INTERFACE_]LINK_LIBRARIES, 2021-05-26, v3.21.0-rc1~126^2) the
TARGET_OBJECTS genex, when referenced for linking, is now evaluated with
EvaluateForBuildsystem enabled.  This causes the object file paths to be
computed with a buildsystem-specific placeholder for the configuration.

This is normally fine because the placeholder will be evaluated by the
native buildsystem tool using the proper configuration.  However, the
Ninja Multi-Config generator's `${CONFIGURATION}` placeholder may not
have the correct value for cross-config object files.  Switch back to
using the per-config location of each object file for this generator.

Fixes: #22436
2021-07-21 11:46:15 -04:00
Brad King
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator 2021-07-20 14:52:01 -04:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Brad King
18e42d3e63 cmGeneratorExpressionNode: Constify local variable 2021-05-28 14:27:38 -04:00
Kyle Edwards
f31e8d33ef Genex: Fix grammatical error in TARGET_OBJECTS error message 2021-02-24 14:55:17 -05:00
Kyle Edwards
d34d28e688 Genex: Add TARGET_RUNTIME_DLLS genex
Co-Authored-by: Brad King <brad.king@kitware.com>
2021-02-24 14:55:17 -05:00
Cengizhan Pasaoglu
bd705788f6 Constify some code as suggested by clang-tidy 2020-10-20 00:04:04 +03:00