summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.h
Commit message (Collapse)AuthorAgeFilesLines
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+2
| | | | | 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.
* cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utilityDaniel Eiband2019-09-231-0/+13
| | | | | | | cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is needed or an instance of cmCompiledGeneratorExpression cannot be cached. Fixes: #19686
* cmGeneratorExpression: Remove Evaluate overload by parameter re-orderingDaniel Eiband2019-09-221-6/+1
| | | | | | | | 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.
* cmGeneratorExpression: Move quiet flag to cmCompiledGeneratorExpressionDaniel Eiband2019-09-221-12/+13
| | | | | | 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.
* 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.
* clang-tidy: Use `= delete`Regina Pfeifer2019-01-291-8/+14
|
* clang-tidy: Pass by valueRegina Pfeifer2019-01-221-8/+8
|
* Refactoring: introduce function to check if a string is a generator expressionMarc Chevrier2018-09-251-0/+9
|
* genex: Simplify cmGeneratorExpressionInterpreterBrad King2018-09-071-50/+5
| | | | | | | | | All callers were constructing with a non-empty target name using the target whose pointer was passed anyway. Drop this argument. Simplify logic accordingly. Re-order constructor arguments to match the cmCompiledGeneratorExpression::Evaluate arguments. Also remove unnecessary getters.
* Genex: Return Evaluate results as const std::string&Vitaly Stakhovsky2018-08-281-11/+4
| | | | Also remove unused overloads.
* EvaluateExpression() returns std::stringVitaly Stakhovsky2018-08-161-10/+7
|
* cmCompiledGeneratorExpression::Evaluate(): return const std::string&Vitaly Stakhovsky2018-08-091-16/+20
|
* Genex: Per-source $<COMPILE_LANGUAGE:...> supportMarc Chevrier2017-12-131-6/+41
| | | | Fixes: #17542
* Refactor per-source generator expression evaluationMarc Chevrier2017-12-041-0/+50
| | | | | | Prepare to add generator expression support to more source properties. Factor out some duplicated code into a helper to avoid further duplication.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-3/+4
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-6/+6
|
* Use CM_DISABLE_COPYDaniel Pfeifer2017-04-241-6/+4
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-8/+6
|
* make sure to include cmConfigure.h before cmStandardIncludes.hDaniel Pfeifer2016-09-031-0/+2
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-4/+3
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-6/+6
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-34/+37
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Genex: Port some access API to cmGeneratorTarget.Stephen Kelly2015-10-151-10/+9
|
* cmGeneratorExpression: Port interface to cmGeneratorTarget.Stephen Kelly2015-10-121-3/+4
|
* cmGeneratorExpression: Port to cmLocalGenerator.Stephen Kelly2015-10-121-3/+3
|
* Genex: Store a backtrace, not a pointer to one.Stephen Kelly2015-07-171-2/+3
| | | | | | | | | | The storage of a pointer means that the ownership and lifetime are externally determined, which is harder to reason about. It also imposes API constraints, requiring APIs to return references to backtraces. This pointer storage was introduced in commit v3.1.0-rc1~425^2~3 (genex: remove the need for backtraces, 2014-05-23). As backtraces are now cheap to copy around, just do that instead.
* Genex: Extract an evaluateWithContext method.Stephen Kelly2015-03-101-0/+4
| | | | | Make it easier to make modifications to the context before evaluating with it.
* Genex: Add a COMPILE_LANGUAGE generator expression.Stephen Kelly2015-03-071-2/+4
|
* file(GENERATE): Evaluate early to allow generating source filesStephen Kelly2014-11-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The evaluation files must be known before cmTargetTraceDependencies attempts to find them, but we must actually generate the files after cmTargetTraceDependencies, as that can add to target SOURCES. The limitation is that the generated output name must not depend on the SOURCES of a target if the generated file is used by that target. Mark the output files as GENERATED so that trace dependencies does not expect them to already exist in the filesystem. Move the invokation of ForceLinkerLanguage in the Generate logic to after the generated file names are known. ForceLinkerLanguage tries to determine the sources of a target (in order to determine an already-known language) and otherwise fails to get information about the generated file. Test that the output of file(GENERATE) can be used as a target source file and that accessing the target SOURCES in the name of the output file is an error. Accessing the TARGET_OBJECTS would be a similar error if it was legal to use that generator expression in this context. That is not currently possible and is a different error condition, so test the current error output as a reminder to change the expected output if that becomes possible in the future. Test that generated rule files resulting from cmTargetTraceDependencies appear in the SOURCES generated in the output file.
* Genex: Track whether an expression depends on the 'head' targetBrad King2014-07-211-0/+5
|
* genex: remove the need for backtracesBen Boeckel2014-06-051-2/+2
| | | | | Rather than making dummy backtraces and passing them around, just make backtraces optional.
* Features: Add COMPILE_FEATURES generator expression.Stephen Kelly2014-05-211-0/+5
| | | | | | | | | | | | Allow setting build properties based on the features available for a target. The availability of features is determined at generate-time by evaluating the link implementation. Ensure that the <LANG>_STANDARD determined while evaluating COMPILE_FEATURES in the link implementation is not lower than that provided by the INTERFACE of the link implementation. This is similar to handling of transitive properties such as POSITION_INDEPENDENT_CODE.
* Genex: Only evaluate TARGET_OBJECTS to determine target sources.Stephen Kelly2014-04-021-0/+6
| | | | | | | | | | The output of this expression may contain macros for IDEs to replace such as $(Configuration), $(CURRENT_ARCH) etc. To avoid generating content which is not usable in other contexts, report an error if there is an attempt to use it in other contexts. This commit may be reverted in the future if a solution to the above difference is implemented.
* cmGeneratorExpression: Remove unused include.Stephen Kelly2014-03-171-2/+0
|
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-2/+2
|
* cmGeneratorExpression: Tokenize over stringsBen Boeckel2014-03-081-2/+2
|
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-2/+2
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-5/+5
| | | | | | This has follow-on effects for other methods and classes. Further work on making the use of const cmTarget pointers common can be done, particularly with a view to generate-time methods.
* Genex: Rename cmGeneratorExpression::NeedsParsing to NeedsEvaluationStephen Kelly2013-08-291-1/+1
|
* Genex: Allow relative paths in INSTALL_INTERFACE.Stephen Kelly2013-07-251-1/+2
| | | | | | | These paths can be prepended with the ${_IMPORT_PREFIX} generated in the export file. Such relative paths were previously an error.
* Merge topic 'interface-property-external-read'Brad King2013-02-251-0/+1
|\ | | | | | | | | | | | | | | | | | | 8dfdf1c Fix the tests for evaluating includes and defines. 98a6725 Fix constness of accessors. 7e70744 Expand includes and defines transitively in 'external' genexes. d1a2729 Fix DAG checker finding cycling dependencies. e72eaad Workaround broken code where a target has itself in its link iface. ec2c67b Strip stray semicolons when evaluating generator expressions.
| * Strip stray semicolons when evaluating generator expressions.Stephen Kelly2013-02-181-0/+1
| |
* | Keep track of all targets seen while evaluating a genex.Stephen Kelly2013-02-221-2/+6
|/ | | | | As dependencies of the generator expression, these will re-exported in try_compile generated code.
* Don't keep track of content determined by target property values.Stephen Kelly2013-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This tracking was added during the development of commit 042ecf04 (Add API to calculate link-interface-dependent bool properties or error., 2013-01-06), but was never used. It was not necessary to use the content because what is really useful in that logic is to determine if a property has been implied to be null by appearing in a LINK_LIBRARIES genex. I think the motivating usecase for developing the feature of keeping track of the targets relevant to a property was that I thought it would make it possible to allow requiring granular compatibility of interface properties only for targets which depended on the interface property. Eg: add_library(foo ...) add_library(bar ...) add_executable(user ...) # Read the INTERFACE_POSITION_INDEPENDENT_CODE from bar, but not # from foo: target_link_libraries(user foo $<$<TARGET_PROPERTY:POSTITION_INDEPENDENT_CODE>:bar>) This obviously doesn't make sense. We require that INTERFACE properties are consistent across all linked targets instead.
* De-duplicate validation of genex target names.Stephen Kelly2013-02-071-0/+2
|