summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmTarget: Avoid computing languages when computing transitive targets.Stephen Kelly2014-02-241-3/+3
| | | | | | | | | | | | | | | | For the OLD CMP0022 behavior, we need to treat the implementation as the interface when computing the interface libraries. Make it possible to do that without computing the link languages by adding a new GetLinkImplementationLibraries method. Extend the existing GetLinkImplementation method to populate the languages if the libraries have already been computed and cached. Change GetTransitivePropertyTargets to invoke GetLinkInterfaceLibraries instead of GetLinkInterface. This is key, as it is a method called by cmGeneratorExpressionEvaluator. Change the cmGeneratorExpressionEvaluator to invoke GetLinkImplementationLibraries instead of GetLinkImplementation.
* cmTarget: Change GetTransitivePropertyLinkLibraries to output targets.Stephen Kelly2014-02-241-16/+35
| | | | | | | The callers already skip non-targets, so unify the target search. Change supporting functions to accept a container of targets instead of strings where possible.
* cmMakefile: make some methods take const std::string& instead of const char*Rolf Eike Beer2014-01-161-7/+5
| | | | | | | | Most callers already have a std::string, on which they called c_str() to pass it into these methods, which internally converted it back to std::string. Pass a std::string directly to these methods now, avoiding all these conversions. Those methods that only pass in a const char* will get the conversion to std::string now only once.
* Genex: Use case-sensitive comparison for COMPILER_ID.Stephen Kelly2014-01-081-1/+23
|
* cmTarget: Deprecate COMPILE_DEFINITIONS_ properties with a policy.Stephen Kelly2014-01-081-1/+6
|
* Genex: Add a nullary form for CONFIGStephen Kelly2014-01-071-2/+6
| | | | | | | | | | | | | This is consistent with other similar expressions such as PLATFORM_ID, and makes the CONFIGURATION expression obsolete. Fix an off-by-one error in GeneratorExpressionContent::EvaluateParameters exposed by a unit test. Remove the test for 'bad' nullary use of $<CONFIG>. Add a unit test to verify that $<CONFIG> and $<CONFIGURATION> have the same value.
* Genex: Make EQUAL support upper case binary literalsStephen Kelly2014-01-061-6/+6
| | | | | | | | As C++11, python, D and java do. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf Add test for uppercase hex literals.
* Genex: Fix case of methods in the dag checker.Stephen Kelly2014-01-061-2/+2
|
* Undefine local preprocessor loop variables.Stephen Kelly2014-01-061-0/+3
| | | | | Most occurances of this pattern already contain the undef, so add it to the rest too.
* Genex: Reform error-checking for nullary/unary expressions.Stephen Kelly2014-01-061-29/+10
| | | | | | The error messages were incorrect (reporting that the expression requires one or two parameters), and repeated. Remove the now-unused ZeroOrMoreParameters enum value.
* Genex: Add EQUAL expression.Stephen Kelly2014-01-061-0/+89
| | | | Support decimal, hex, octal and binary literals.
* Genex: Use case-sensitive comparison in PLATFORM_ID.Stephen Kelly2013-12-191-1/+1
|
* Genex: Always return immediately on error.Stephen Kelly2013-12-191-0/+4
|
* Genex: Accept arbitrary content in *_CASE and MAKE_C_IDENTIFIER.Stephen Kelly2013-12-191-0/+6
|
* Genex: Allow single param expressions to accept arbirary input.Stephen Kelly2013-12-191-31/+23
| | | | | | | | | | | | | | Existing single-parameter expressions work due to special casing which assumes that if there is only one parameter, and the node accepts arbitrary content, then the result is the input. This is true for the existing expressions matching that pattern - namely the "1" and "TARGET_NAME" expressions. However, the LOWER_CASE, and UPPER_CASE expressions should also accept arbitrary content, and in their case, the result is not the input. Refactor the cmGeneratorExpressionEvaluator to allow that extension. Actually evaluate the "1" and "0" nodes.
* Genex: Add {UPPER,LOWER}_CASE and MAKE_C_IDENTIFIER.Stephen Kelly2013-11-271-0/+48
|
* INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.Stephen Kelly2013-11-251-1/+2
| | | | | | | | | | | | | As an INTERFACE_LIBRARY has no direct link dependencies, we can short-circuit in cmGeneratorExpressionEvaluator and in cmGlobalGenerator::CheckLocalGenerators. As they do not generate any output directly, any generate- or install- related code acn also be short-circuited. Many of the local generators already do this. Because only INTERFACE related properties make sense on INTERFACE_LIBRARY targets, avoid setting other properties, for example via defaults.
* Use new cmHasLiteralPrefix functionStephen Kelly2013-11-211-2/+2
|
* Genex: Use a preprocessor foreach to follow transitive properties.Stephen Kelly2013-11-091-17/+12
|
* Genex: Simplify the preprocessor looper for interface properties.Stephen Kelly2013-11-091-1/+1
| | | | By removing the INTERFACE_ prefix, we can use this in more contexts.
* Merge topic 'object-library-no-TARGET_FILE'Brad King2013-11-021-1/+1
|\ | | | | | | | | d960589 Genex: Reject $<TARGET_FILE:...> for object libraries (#14532)
| * Genex: Reject $<TARGET_FILE:...> for object libraries (#14532)Brad King2013-11-011-1/+1
| | | | | | | | | | | | | | | | | | Teach the cmGeneratorExpressionEvaluator filesystem artifact logic to reject OBJECT_LIBRARY targets since they have no main artifact. Without the explicit rejection evaluation falls through to an internal CMake error message in cmTarget::GetOutputInfo. Extend the RunCMake.GeneratorExpression test to cover these cases.
* | cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-5/+7
| | | | | | | | | | | | 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.
* | cmTarget: Add interface for compatible numeric propertiesStephen Kelly2013-10-241-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the boost MPL library, one can set a define to increase the limit of how many variadic elements should be supported. The default for BOOST_MPL_LIMIT_VECTOR_SIZE is 20: http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/limit-vector-size.html If the foo library requires that to be set to 30, and the independent bar library requires it to be set to 40, consumers of both need to set it to 40. add_library(foo INTERFACE) set_property(TARGET foo PROPERTY INTERFACE_boost_mpl_vector_size 30) set_property(TARGET foo PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX boost_mpl_vector_size) target_compile_definitions(foo INTERFACE BOOST_MPL_LIMIT_VECTOR_SIZE=$<TARGET_PROPERTY:boost_mpl_vector_size>) add_library(bar INTERFACE) set_property(TARGET bar PROPERTY INTERFACE_boost_mpl_vector_size 40) # Technically the next two lines are redundant, but as foo and bar are # independent, they both set these interfaces. set_property(TARGET bar PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX boost_mpl_vector_size) target_compile_definitions(bar INTERFACE BOOST_MPL_LIMIT_VECTOR_SIZE=$<TARGET_PROPERTY:boost_mpl_vector_size>) add_executable(user) target_link_libraries(user foo bar) Because the TARGET_PROPERTY reads the boost_mpl_vector_size property from the HEAD of the dependency graph (the user target), and because that property appears in the COMPATIBLE_INTERFACE_NUMBER_MAX of the dependencies of the user target, the maximum value for it is chosen for the compile definition, ie, 40. There are also use-cases for choosing the minimum value of a number. In Qt, deprecated API can be disabled by version. Setting the definition QT_DISABLE_DEPRECATED_BEFORE=0 disables no deprecated API. Setting it to 0x501000 disables API which was deprecated before Qt 5.1 etc. If two dependencies require the use of API which was deprecated in different Qt versions, then COMPATIBLE_INTERFACE_NUMBER_MIN can be used to ensure that both can compile.
* | Merge topic 'cmarray-templates'Brad King2013-10-231-25/+10
|\ \ | | | | | | | | | | | | | | | | | | d169b1f Genex: Use cmArraySize for targetPolicyWhitelist 86d5d80 Genex: Remove use of TransitiveWhitelistCompare 73d7705 Add some templates for cleaner array iteration.
| * | Genex: Use cmArraySize for targetPolicyWhitelistStephen Kelly2013-10-221-4/+1
| | | | | | | | | | | | For better readability.
| * | Genex: Remove use of TransitiveWhitelistCompareStephen Kelly2013-10-221-21/+9
| | | | | | | | | | | | | | | Replace with generic solution based on cmArray* for better readability.
* | | use size_t for GeneratorExpressionContent::ContentLength to fix some warningsRolf Eike Beer2013-10-211-1/+1
|/ / | | | | | | | | | | CMake/Source/cmGeneratorExpressionParser.cxx: In member function ‘void cmGeneratorExpressionParser::ParseGeneratorExpression(std::vector<cmGeneratorExpressionEvaluator*>&)’: CMake/Source/cmGeneratorExpressionParser.cxx:116:55: warning: conversion to ‘unsigned int’ from ‘long int’ may alter its value [-Wconversion] CMake/Source/cmGeneratorExpressionParser.cxx:240:39: warning: conversion to ‘int’ from ‘long int’ may alter its value [-Wconversion]
* | Merge topic 'PLATFORM_ID-genex'Brad King2013-10-071-0/+35
|\ \ | |/ |/| | | | | dcc00ec Genex: Add the PLATFORM_ID expression.
| * Genex: Add the PLATFORM_ID expression.Stephen Kelly2013-08-281-0/+35
| |
* | Genex: Fix evaluation of MAP_IMPORTED_CONFIG_<CONFIG>Stephen Kelly2013-08-271-2/+3
|/ | | | | | | | | | | Commit 10a069b5 (Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations., 2013-07-15) changed the logic here to include handling of the MAP_IMPORTED_CONFIG_<CONFIG> target property, but it was buggy in several ways. Uppercase the configs in all cases, and compare the mapped configs with the parameter to the CONFIG genex, instead of with the key of the mapping.
* Add the ALIAS target concept for libraries and executables.Stephen Kelly2013-08-021-0/+12
| | | | | | | | | | | | | | | | | * The ALIAS name must match a validity regex. * Executables and libraries may be aliased. * An ALIAS acts immutable. It can not be used as the lhs of target_link_libraries or other commands. * An ALIAS can be used with add_custom_command, add_custom_target, and add_test in the same way regular targets can. * The target of an ALIAS can be retrieved with the ALIASED_TARGET target property. * An ALIAS does not appear in the generated buildsystem. It is kept separate from cmMakefile::Targets for that reason. * A target may have multiple aliases. * An ALIAS target may not itself have an alias. * An IMPORTED target may not have an alias. * An ALIAS may not be exported or imported.
* Genex: Disallow LINKER_LANGUAGE only when used on a static library.Stephen Kelly2013-07-261-2/+3
| | | | | For shared libraries and executables, the linker_language is indepenedent of the linked libraries.
* Merge topic 'fix-mapped-config-genex'Brad King2013-07-241-2/+18
|\ | | | | | | | | 10a069b Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
| * Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.Stephen Kelly2013-07-241-2/+18
| | | | | | | | | | | | | | | | The old code checked only that there was a LOCATION for the specified config, but did not check whether the config actually mapped. Task-number: 14292
* | Remove the LINK_LANGUAGE generator expression.Stephen Kelly2013-07-241-65/+13
| | | | | | | | | | | | | | | | | | | | | | It accepted an optional argument to test for equality, but no way to get the linker language of a particular target. TARGET_PROPERTY provides this flexibility and STREQUAL provides the necessary API for equality test. Extend the CompileDefinitions test to cover accessing the property of another target.
* | Merge topic 'tid-system-argument'Brad King2013-07-161-0/+4
|\ \ | |/ |/| | | | | | | | | | | | | | | 9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. 1925cff Add a SYSTEM parameter to target_include_directories (#14180) 286f227 Extend the cmTargetPropCommandBase interface property handling. 83498d4 Store system include directories in the cmTarget. f1fcbe3 Add Target API to determine if an include is a system include. 2679a34 Remove unused variable.
| * Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.Stephen Kelly2013-07-161-0/+4
| | | | | | | | | | | | | | | | Unlike other target properties, this does not have a corresponding non-INTERFACE variant. This allows propagation of system attribute on include directories from link dependents.
* | Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICYStephen Kelly2013-07-111-15/+21
| | | | | | | | | | | | Use preprocessor loops and add a unit test for the appropriate policies. All policies whose value is recorded at target creation time should be part of this list.
* | Introduce the LINK_ONLY generator expression.Stephen Kelly2013-07-071-0/+20
| | | | | | | | | | This is an internal expression for use by target_link_libraries for static libraries.
* | GenexEval: Add abstracted access to link interface for a target.Stephen Kelly2013-07-071-5/+6
|/ | | | | | This can be extended with special handling for static libraries so that we can process the link dependencies separately from the usage dependencies.
* Add generator expressions for compiler versions.Stephen Kelly2013-06-281-0/+100
| | | | | New generator expressions allow retrieval of the version per language, as well as equality comparison.
* Merge topic 'dag-LINKER_LANGUAGE'Brad King2013-06-261-2/+17
|\ | | | | | | | | | | | | | | ff015ee Genex: Report error if a target file is needed to evaluate link libraries. b58aff9 Genex: Extend EvaluatingLinkLibraries to also check the top target name. b1c19ce Genex: Make LINK_LANGUAGE report an error when evaluating link libraries. 0e1cb07 Add missing return after error report.
| * Genex: Report error if a target file is needed to evaluate link libraries.Stephen Kelly2013-06-241-1/+8
| | | | | | | | | | | | | | | | Constructs such as target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,foo.so>:bar>) segfault before this patch.
| * Genex: Make LINK_LANGUAGE report an error when evaluating link libraries.Stephen Kelly2013-06-241-1/+8
| |
| * Add missing return after error report.Stephen Kelly2013-06-241-0/+1
| |
* | Merge topic 'version-compare-genex'Brad King2013-06-261-0/+60
|\ \ | |/ |/| | | | | | | e605528 Add generator expressions for version comparision. 48bb48e De-duplicate version comparison code.
| * Add generator expressions for version comparision.Stephen Kelly2013-06-121-0/+60
| |
* | Merge topic 'transitive-property-PP-FOR_EACH'Brad King2013-06-241-9/+15
|\ \ | | | | | | | | | | | | 0d8db25 Use a preprocessor loop to manage the valid transitive properties.
| * | Use a preprocessor loop to manage the valid transitive properties.Stephen Kelly2013-06-101-9/+15
| |/ | | | | | | | | Hopefully this will prevent regressions when adding further transitive properties in the future.