summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'source_sweep_ostringstream_single'Brad King2019-08-261-3/+3
|\ | | | | | | | | | | | | 3b2b02825d Source sweep: Replace std::ostringstream when used with a single append Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3726
| * Source sweep: Replace std::ostringstream when used with a single appendSebastian Holtermann2019-08-231-3/+3
| | | | | | | | | | | | | | This replaces `std::ostringstream`, when it is written to only once. If the single written argument was numeric, `std::to_string` is used instead. Otherwise, the single written argument is used directly instead of the `std::ostringstream::str()` invocation.
* | Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-6/+3
|/ | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Merge topic 'isolate-declarations'Brad King2019-08-221-3/+6
|\ | | | | | | | | | | | | d331021255 clang-tidy: isolate declarations for readability Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3704
| * clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-3/+6
| |
* | Merge topic 'shared-string'Brad King2019-08-211-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | be7807478c cmDefinitions: Reduce allocation of keys and values in MakeClosure e07e2bc8bb bootstrap: Compile cm::String c1787cb5eb cpack.cxx: Re-order include blocks to follow our conventions 141e307484 cmConfigure.h: Tell windows.h not to define min/max macros Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3669
| * | cmDefinitions: Reduce allocation of keys and values in MakeClosureBrad King2019-08-201-1/+1
| |/ | | | | | | | | | | | | Use `cm::String` to store keys and values so that `MakeClosure` does not need to allocate new copies of all of them. Issue: #19581
* | Merge topic 'cm-contains'Brad King2019-08-211-9/+4
|\ \ | |/ |/| | | | | | | | | | | | | 2dfc52675c cmAlgorithms: Add cmContains Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !3700
| * cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-9/+4
| | | | | | | | Also, use the new function where applicable.
* | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-1/+1
|/ | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-12/+10
|
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-1/+1
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* Genex: Optimize build setting TARGET_PROPERTY evaluationBrad King2019-07-231-40/+35
| | | | | | | | | | | | | | | For each build setting property (such as `COMPILE_DEFINITIONS` or `INCLUDE_DIRECTORIES`), the value of `$<TARGET_PROPERTY:target,prop>` includes the values of the corresponding `INTERFACE_*` usage requirement property from the transitive closure of link libraries of the target. Previously we computed this by constructing a generator expression string like `$<TARGET_PROPERTY:lib,INTERFACE_COMPILE_DEFINITIONS>` and recursively evaluating it with the generator expression engine. Avoid the string construction and parsing by using the dedicated evaluation method `cmGeneratorTarget::EvaluateInterfaceProperty`. Issue: #18964, #18965
* Genex: Optimize usage requirement TARGET_PROPERTY recursionBrad King2019-07-231-22/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In large projects the generation process spends a lot of time evaluating usage requirements through transitive interface properties on targets. This can be seen in a contrived example with deep dependencies: set(prev "") foreach(i RANGE 1 500) add_library(a${i} a.c) target_compile_definitions(a${i} PUBLIC A${i}) target_link_libraries(a${i} PUBLIC ${prev}) set(prev a${i}) endforeach() For each usage requirement (such as `INTERFACE_COMPILE_DEFINITIONS` or `INTERFACE_INCLUDE_DIRECTORIES`), the value of the generator expression `$<TARGET_PROPERTY:target,prop>` includes the values of the same property from the transitive closure of link libraries of the target. Previously we computed this by constructing a generator expression string like `$<TARGET_PROPERTY:lib,INTERFACE_COMPILE_DEFINITIONS>` and recursively evaluating it with the generator expression engine. Avoid the string construction and parsing by creating and using a dedicated evaluation method `cmGeneratorTarget::EvaluateInterfaceProperty` that looks up the properties directly. Issue: #18964, #18965
* Genex: In TARGET_PROPERTY check for usage reqs in link libs earlierBrad King2019-07-211-25/+26
|
* Genex: Re-order TARGET_PROPERTY logic to de-duplicate checksBrad King2019-07-211-42/+26
| | | | | Check for usage requirement properties early enough to avoid duplicate checks in other conditions.
* Genex: Move TARGET_PROPERTY linked targets evaluation to endBrad King2019-07-211-35/+28
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Genex: CompileLang and CompileLangAndId now match against a list of idsRobert Maynard2019-06-031-4/+11
| | | | | | This allows for expressions such as: $<COMPILE_LANG_AND_ID, CXX, GNU, Clang>
* Genex: PlatformId now can match against a list of ids.Robert Maynard2019-06-031-3/+5
|
* Genex: CompilerId now can match against a list of ids.Robert Maynard2019-06-031-25/+28
| | | | | This allows for expressions like: $<$<CXX_COMPILER_ID:Clang,GNU>:-DMY_PRIVATE_DEFINE>
* Genex: Fix value lifetimes in nested TARGET_PROPERTY evaluationBrad King2019-05-221-3/+8
| | | | | | | | | | | For special properties like `INCLUDE_DIRECTORIES`, the pointer returned by `cmTarget::GetProperty` is only valid until the next time the same special property is queried on *any* target. When evaluating a nested `TARGET_PROPERTY` generator expression we may look up such a property more than once on different targets. Fix `TargetPropertyNode::Evaluate` to store the lookup result in locally owned memory earlier. Fixes: #19286
* Genex: Add COMPILE_LANG_AND_ID generator expressionRobert Maynard2019-05-141-0/+46
|
* Merge topic 'genex-TARGET_FILE_BASE_NAME-manage-postfix'Brad King2019-05-031-3/+6
|\ | | | | | | | | | | | | | | 6e5ccabe9b Genex: Update $<TARGET_FILE_BASE_NAME:...>: take care of POSTFIX 1f4c9aa7d2 Refactor: introduce method cmGeneratorTarget::GetFilePostfix Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3267
| * Genex: Update $<TARGET_FILE_BASE_NAME:...>: take care of POSTFIXMarc Chevrier2019-05-021-3/+6
| | | | | | | | | | This capability complement MR !3190 and !3207 and is also needed to solve issue #18771.
* | Merge topic 'genex-code-cleanup'Brad King2019-05-021-416/+175
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | 3d856eba16 cmGeneratorExpressionNode: refactor TargetPropertyNode 9e1df5df54 cmGeneratorExpressionNode: use ctor arguments instead of macro 36f36d6a49 cmGeneratorExpressionNode: add VersionNode 3f57787dff cmGeneratorExpressionNode: remove structs CompilerId*, CompilerVersion* 20d7c5631e cmGeneratorExpressionNode: add CharacterNode abd62201bd cmGeneratorExpressionNode: simplify code in EqualNode f2c8ff8259 cmGeneratorExpressionNode: Simplify static string constant Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3234
| * cmGeneratorExpressionNode: refactor TargetPropertyNodeLeonid Pospelov2019-04-221-48/+49
| | | | | | | | | | Re-order logic to improve readability and de-duplicate conditions. Factor out error message generation into a helper.
| * cmGeneratorExpressionNode: use ctor arguments instead of macroLeonid Pospelov2019-04-221-30/+36
| |
| * cmGeneratorExpressionNode: add VersionNodeLeonid Pospelov2019-04-221-84/+10
| |
| * cmGeneratorExpressionNode: remove structs CompilerId*, CompilerVersion*Leonid Pospelov2019-04-221-166/+43
| |
| * cmGeneratorExpressionNode: add CharacterNodeLeonid Pospelov2019-04-221-36/+8
| |
| * cmGeneratorExpressionNode: simplify code in EqualNodeLeonid Pospelov2019-04-221-54/+29
| |
| * cmGeneratorExpressionNode: Simplify static string constantBrad King2019-04-221-2/+4
| | | | | | | | | | Use our `""_s` user-defined literal to avoid initializing a static std::string.
* | Merge topic 'relax_TARGET_OBJECT_generator_expr'Brad King2019-04-301-2/+8
|\ \ | | | | | | | | | | | | | | | | | | ce078dda79 Relax the usage of TARGET_OBJECTS generator expression Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3178
| * | Relax the usage of TARGET_OBJECTS generator expressionRobert Maynard2019-04-191-2/+8
| | | | | | | | | | | | | | | The geneator expression can now be used with static, shared, and module libraries and executables.
* | | Genex: Rename $<TARGET_*_OUTPUT_NAME:...> in $<TARGET_*_FILE_BASE_NAME:...>Marc Chevrier2019-04-151-16/+16
| |/ |/|
* | Genex: add $<TARGET_FILE_PREFIX:...> and $<TARGET_FILE_SUFFIX:...>Marc Chevrier2019-04-101-0/+117
| | | | | | | | | | These capabilities complement MR !3190 and is also needed to solve issue #18771.
* | Genex: Add $<FILTER:list,INCLUDE|EXCLUDE,regex>Sebastian Lipponer2019-04-081-0/+47
| |
* | Genex: Add capability to retrieve base name for various target artifactsMarc Chevrier2019-04-081-0/+123
| | | | | | | | This new capability is required to solve efficiently issue #18771
* | Refactor struct TargetFileSystemArtifactMarc Chevrier2019-04-081-10/+31
| | | | | | | | | | Creates base class TargetArtifactBase which enable to share code with future new functionalities.
* | Genex: Add $<REMOVE_DUPLICATES:list>Sebastian Lipponer2019-04-011-0/+30
|/
* Merge topic 'cuda_compiler_generator_expressions'Brad King2019-03-131-2/+48
|\ | | | | | | | | | | | | | | b53766b205 CUDA: Support compiler id and version generator expressions b544e34af6 All VersionNode use the same capitalization pattern Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3085
| * CUDA: Support compiler id and version generator expressionsRobert Maynard2019-03-111-0/+46
| | | | | | | | | | Introduce the CUDA_COMPILER_ID and CUDA_COMPILER_VERSION generator expressions.
| * All VersionNode use the same capitalization patternRobert Maynard2019-03-111-2/+2
| |
* | Genex: Teach SHELL_PATH to support a list of pathsHenri Manson2019-03-111-4/+20
|/ | | | | | | Extend the genex added by commit ca6ba3fee5 (Genex: Add a SHELL_PATH expression, 2015-09-24, v3.4.0-rc1~37^2) to accept a `;`-list of paths, convert them all, and generate a list separated by the native shell `PATH``` separator.
* cmGeneratorExpressionNode: Initialize node key map in class constructorSebastian Holtermann2019-02-271-68/+69
| | | | | By initializing the node map in the class constructor of the static instance we avoid an if-empty check.
* Merge topic 'genex-GENEX_EVAL-fix-recursion'Brad King2019-02-131-2/+2
|\ | | | | | | | | | | | | | | e429e9af42 genex: Fix erroneous handling of recursion for $<GENEX_EVAL:> Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: yrHeTaTeJlb <jjj.bo@yandex.ru> Merge-request: !2954
| * genex: Fix erroneous handling of recursion for $<GENEX_EVAL:>Marc Chevrier2019-02-131-2/+2
| | | | | | | | Fixes: #18894