Commit Graph

211 Commits

Author SHA1 Message Date
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
Deniz Bahadir
2f76e7429b OBJECT libraries: Properly recognize if sources depend on configuration
Fixes: #21198
2020-09-23 10:05:55 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Brad King
8f73ff0c37 Merge topic 'target_genex_dependency'
f14b390198 GenEx: Remove unneeded dependencies from target info queries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5127
2020-09-01 09:59:08 -04:00
Robert Maynard
f14b390198 GenEx: Remove unneeded dependencies from target info queries
Only generate a graph dependency between a custom command and
a target when the custom command queries for the file path
of an artifact of the target.

This makes generator expressions such as `TARGET_FILE_DIR`
behave the same way as `TARGET_PROPERTY` which never generated
a graph dependency.
2020-09-01 09:25:19 -04:00
Robert Maynard
34cc6acc81 Add ISPC compiler support to CMake 2020-08-28 11:21:31 -04:00
Marc Chevrier
af1a4f52be Genex: $<TARGET_PROPERTY> strip emtpy list elements for predefined properties
Fixes: #20951
2020-07-21 15:08:28 +02:00
Marc Chevrier
6491d2503c Genex $<COMPILE_LANGUAGE>: Extend contexts supported
When genex $<TARGET_PROPERTY:...> for properties like INCLUDE_DIRECTORIES
is evaluated as part of add_custom_command or add_custom_target,
genex $<COMPILE_LANGUAGE> and $<COMPLIE_LANG_AND_ID> should be supported.

Fixes: #20926
2020-07-13 16:27:19 +02:00
Robert Maynard
dc94b0249e cmStandardLevelResolver: Added to handle standard level queries
Refactored out of cmMakefile
2020-07-01 07:58:58 -04:00
Robert Maynard
eae15dce6a Genex: $<CONFIG:> now supports multiple configurations
Instead of having to do $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>
you can do $<CONFIG:Release,MinSizeRel>
2020-06-24 08:38:28 -04:00
Justin Goshi
742ff97f80 Refactor language standard computation
Instead of mutating the configure-time cmTarget's properties at generate
time, compute and store it in a cmGeneratorTarget field.
2020-06-16 16:32:34 -07:00
Justin Goshi
0892c798f7 cmMakefile: Change CompileFeatureKnown to take target name instead of target
The implementation needs only the target name.
2020-06-15 11:31:03 -04:00
Marc Chevrier
056489d567 add_library/add_executable: allow local alias to imported targets
Fixes: #20641
2020-06-02 17:11:47 +02:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Brad King
68a59ab288 Merge topic 'stl-support'
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4689
2020-05-01 08:27:37 -04:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Marc Chevrier
3fdae5acaa Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>
These generator expressions can only be used in link options properties.
These expressions return the arguments respectively for device and host link
step, otherwise return an empty string.
2020-04-19 15:04:54 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Vitaly Stakhovsky
3eec21a01c cmTarget::GetProperty: return cmProp 2020-03-30 15:00:14 -04:00
Vitaly Stakhovsky
b915fec56e cmTarget: minor code improvements 2020-03-17 08:33:57 -04:00
Marc Chevrier
461efa7b51 Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...>
This MR may help to solve issues #19757 and #18008

Fixes: #19965
2020-02-26 16:38:42 +01:00
Marc Chevrier
8f839d02e3 cm::String: enhance compatibility with STL 2020-01-25 18:16:16 +01:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Steve Wilson
9e66397c28 Languages: Add support for Objective-C++
Add entries in Modules and Modules/Platform to support
Objective-C++ compiler determination and identification.
Add Modules to check Objective-C++ compiler flags, source
compilations, program checks, etc...

Use OBJCXX as the designator of the language, eg:

project(foo OBJCXX)

Add various tests for Objective-C++ language features.  Add
tests to preserve C++ handling of .M and .mm files when
Objective-C++ is not a configured language.

Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
2019-09-28 15:56:53 +02:00
Daniel Eiband
c12222db86 cmGeneratorExpression: Remove Evaluate overload by parameter re-ordering
Simplify by re-ordering parameters of cmCompiledGeneratorExpression::Evaluate
so that frequently used parameters are before less frequently used parameters.
This allows with little extra arguments to get rid of one Evaluate overload,
which makes it easier to implement the cmGeneratorExpression::Evaluate utility.
The latter would otherwise need four overloads.
2019-09-22 09:51:19 +02:00
Daniel Eiband
1811411fec cmGeneratorExpression: Move quiet flag to cmCompiledGeneratorExpression
The quiet flag is false for all but one call to Evaluate.  Make the quiet flag
a setter of cmCompiledGeneratorExpression to be able to remove it from the
Evaluate function signature.
2019-09-22 09:49:41 +02:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00