summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'refactor-cmGeneratorExpression'Brad King2015-03-121-1889/+3
|\ | | | | | | | | | | | | | | | | ec428faf Genex: Extend cmGeneratorExpressionContext constructor. 082b6a9d Genex: Split cmGeneratorExpressionContext into own file. 9df1f0fc Genex: Split cmGeneratorExpressionNode into own file. 80b9f0cb Genex: Extract an evaluateWithContext method. 642048ce Help: Move docs of $<0:...> and $<1:...> to output section.
| * Genex: Split cmGeneratorExpressionNode into own file.Stephen Kelly2015-03-101-1889/+3
| |
* | Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|/
* Genex: Allow COMPILE_LANGUAGE when processing include directories.Stephen Kelly2015-03-091-1/+2
| | | | Issue an error if this is encountered by an IDE generator.
* Genex: Allow COMPILE_LANGUAGE when processing compile definitions.Stephen Kelly2015-03-091-3/+12
| | | | Issue an error if this is encountered by an IDE generator.
* Genex: Enable use of COMPILE_LANGUAGE for compile options.Stephen Kelly2015-03-091-0/+34
| | | | | | Follow-ups will allow the use of the generator expression for compile definitions and include directories for non-IDE generators.
* Genex: Add a COMPILE_LANGUAGE generator expression.Stephen Kelly2015-03-071-1/+31
|
* Revert "Attempt to fix the compile of cmake on Sun CC."Stephen Kelly2015-02-171-4/+1
| | | | | | This reverts commit a573a856581118d7a9d8dd7be1f613ba7b1ddb04. The workaround is not needed on supported SolarisStudio compilers.
* Features: Define meaning for no language standard defaultBrad King2015-01-291-2/+9
| | | | | | | | | | | | Define an empty string in CMAKE_<LANG>_STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the <LANG>_STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case.
* Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-3/+3
|
* Merge topic 'delete-algorithm'Brad King2015-01-151-24/+3
|\ | | | | | | | | | | | | | | 65b81da4 cmVariableWatch: Use the cmDeleteAll algorithm with for_each. 30d2de9a cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. 4a6e795b Use the cmDeleteAll algorithm instead of trivial raw loops. abb4a678 Add a generic algorithm for deleting items in a container.
| * cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll.Stephen Kelly2015-01-131-24/+3
| |
* | Merge topic 'fix-COMPILE_FEATURES-genex'Brad King2015-01-151-1/+8
|\ \ | |/ |/| | | | | | | 45ec182d Features: Fix the COMPILE_FEATURES genex for unavailable features. 2bead0eb cmMakefile: Rename a method to what it really does.
| * Features: Fix the COMPILE_FEATURES genex for unavailable features.Stephen Kelly2015-01-121-0/+7
| | | | | | | | | | Previously, the genex tested only for CMake knowledge of the feature, but not compiler knowledge of the feature.
| * cmMakefile: Rename a method to what it really does.Stephen Kelly2015-01-121-1/+1
| | | | | | | | The method does not test availability of compile features.
* | Merge topic 'join-algorithm'Brad King2015-01-121-10/+1
|\ \ | | | | | | | | | | | | | | | | | | 55a73e6b Use the cmJoin algorithm where possible. 8dc8d756 cmStandardIncludes: Add a join algorithm for string containers. b5813cee cmInstallCommand: Remove unused variable.
| * | Use the cmJoin algorithm where possible.Stephen Kelly2015-01-081-10/+1
| | |
* | | Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-7/+7
|/ / | | | | | | All compilers hosting CMake support the std class.
* | Fix some Clang -Wstring-conversion warningsSean McBride2014-12-121-2/+2
| | | | | | | | | | Some false positives, but some flagged faulty asserts where the ! was inside the string instead of outside.
* | Merge topic 'fix-transitive-OBJECT_SOURCES-context'Brad King2014-12-011-34/+40
|\ \ | |/ | | | | | | 672f1001 Genex: Fix evaluation context propagation for TARGET_OBJECTS.
| * Genex: Fix evaluation context propagation for TARGET_OBJECTS.Stephen Kelly2014-11-261-34/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract a new method to encapsulate the requirements of evaluating dependent-expressions, namely, propagation of the EvaluateForBuildsystem setting, which is missing from the getLinkedTargetsContent implementation. Commit v3.1.0-rc1~688^2 (Genex: Only evaluate TARGET_OBJECTS to determine target sources., 2014-03-20) introduced an error case for use of TARGET_OBJECTS outside of the context of generating the buildsystem, as the path to object files may be dependent on buildsystem variables (See bug #15226). Commit v3.1.0-rc1~314^2 (Allow INTERFACE_SOURCES to specify $<TARGET_OBJECTS> (#14970), 2014-07-09) made it possible to propagate such content to dependent targets. While that commit propagated the EvaluateForBuildsystem setting for the case of a TARGET_PROPERTY expression, as generated for direct dependencies of a target in cmTargetInternals::AddInterfaceEntries, it did not add propagation for content from further transitive target dependencies, as determined by getLinkedTargetsContent.
* | Remove some unneeded c_str calls.Stephen Kelly2014-11-231-1/+1
| |
* | file(GENERATE): Evaluate early to allow generating source filesStephen Kelly2014-11-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix whitespace issue.Stephen Kelly2014-11-111-1/+1
| |
* | Merge topic 'genex-target-objects-ordering'Brad King2014-11-101-4/+8
|\ \ | |/ | | | | | | caa4b7b8 genex: Preserve order while evaluating TARGET_OBJECTS
| * genex: Preserve order while evaluating TARGET_OBJECTSClinton Stimpson2014-11-071-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic introduced in commit v3.1.0-rc1~688^2~9 (Genex: Evaluate TARGET_OBJECTS as a normal expression, 2014-02-26) ordered a map by pointer value and then constructed a list of object files by iterating over the map. This is not deterministic. Since commit v3.1.0-rc1~688^2~5 (cmTarget: Allow any generator expression in SOURCES property, 2014-03-18) the order produced by the above-mentioned logic started being used for the actual list of object files on the link line. Since it is not deterministic, spurious re-links occur after re-running CMake simply because the order of objects changed on the link line. Fix this by iterating over the original vector of source files instead of the map. This has a deterministic order.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
|/ | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Merge topic 'genex-build-property-no-head'Brad King2014-08-071-2/+2
|\ | | | | | | | | 3f476bea Genex: Do not consider 'head' when evaluating build properties
| * Genex: Do not consider 'head' when evaluating build propertiesBrad King2014-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | When $<TARGET_PROPERTY> names a build property like COMPILE_DEFINITIONS but not the usage requirement (INTERFACE_) version of it, the value should be that used to build the target. It should not be influenced by a dependent 'head' target like usage requirements are. Extend the CompileDefinitions test with a case covering the corrected behavior. Reviewed-by: Stephen Kelly <steveire@gmail.com>
* | Genex: Remove unnecessary check of context->MakefileBrad King2014-08-061-9/+6
|/ | | | | | The context->Makefile is never NULL, but our checks for it convince Clang scan-build that it might be NULL. Then it warns about later unchecked uses. Drop the unnecessary checks.
* Merge topic 'pdb-genex'Brad King2014-07-311-34/+91
|\ | | | | | | | | | | f86850ef Genex: Implement generator expressions for target PDB files. 028ad318 Genex: Simplify filesytem artifact code
| * Genex: Implement generator expressions for target PDB files.Nils Gladitz2014-07-311-0/+45
| |
| * Genex: Simplify filesytem artifact codeNils Gladitz2014-07-291-35/+47
| |
* | Genex: Track whether an expression depends on the 'head' targetBrad King2014-07-211-0/+14
|/
* Genex: Adjust code layout slightlyBrad King2014-07-161-4/+3
|
* Genex: Refactor empty element stripBrad King2014-07-161-3/+2
| | | | | | In cmGeneratorExpressionEvaluator, teach getLinkedTargetsContent to call cmGeneratorExpression::StripEmptyListElements to transform its return value so that callers do not have to do so.
* Genex: Avoid repeated search of transitive property whitelistBrad King2014-07-161-33/+26
| | | | | | | In cmGeneratorExpressionEvaluator, avoid searching through the list of transitive interface property names repeatedly during evaluation of TargetPropertyNode. Simply record the results of the first search for later re-use.
* Genex: Simplify TARGET_PROPERTY transitive lookupBrad King2014-07-161-65/+31
| | | | | | | In cmGeneratorExpressionEvaluator, make getLinkedTargetsContent a template so it can traverse over either the Libraries in a cmTarget LinkImplementationLibraries or a cmTarget LinkInterfaceLibraries. This also avoids creating a separate vector<cmTarget*>.
* cmTarget: Drop GetTransitivePropertyTargets methodBrad King2014-07-161-3/+13
| | | | Inline the implementation at the only remaining call site.
* cmTarget: Make GetLink*Libraries methods safer to useBrad King2014-07-161-1/+1
| | | | | | | | Split the library lists out of LinkImplementation and LinkInterface into LinkImplementationLibraries and LinkInterfaceLibraries parent classes, respectively. Return these from GetLinkImplementationLibraries and GetLinkInterfaceLibraries, respectively, so that callers cannot access parts of the structures that have not been populated.
* Allow INTERFACE_SOURCES to specify $<TARGET_OBJECTS> (#14970)Brad King2014-07-141-0/+1
| | | | | | | | | | | | Fix cmTarget::GetSourceFiles to set EvaluateForBuildsystem on the $<TARGET_PROPERTY:...,INTERFACE_SOURCES> generator expression so that the $<TARGET_OBJECTS> generator expression is allowed within an INTERFACE_SOURCES value. Extend the InterfaceLibrary test to cover this case. Extend the RunCMake.TargetObjects test to cover failure of $<TARGET_OBJECTS> when used through $<TARGET_PROPERTY:...,INTERFACE_SOURCES> in a non-buildsystem context.
* cmTarget: Refactor LinkImplementation to allow more informationBrad King2014-07-071-2/+2
| | | | | | | Create a cmLinkImplItem class derived from cmLinkItem so more information can be added to link implementation entries than link interface entries. Convert the LinkImplementation Libraries member to hold it. Update client sites accordingly.
* cmGeneratorExpressionEvaluator: Shorten some long linesBrad King2014-07-071-13/+16
| | | | Adjust the definitions of getLinkedTargetsContent to avoid long lines.
* Genex: Fix stack overflow in transitive property evaluation.Stephen Kelly2014-07-011-0/+13
| | | | | | | | | | | | | | | | | | | | Commit v2.8.11~156^2~2 (Expand includes and defines transitively in 'external' genexes., 2013-02-13) introduced a recursive loop and a stack overflow during evaluation of a link implementation which depends on a transitive property, such as add_library(empty1 ...) add_library(empty2 ...) target_link_libraries(empty1 PRIVATE $<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2> ) There is no use-case for code like that currently, but it should not cause a stack overflow. Avoid the recursion by reporting an error early if a case like this is found.
* cmTarget: Lookup targets in LinkInterface and LinkImplementationBrad King2014-06-231-5/+5
| | | | | | | | | | | | | | | Instead of storing just the string names in these structures, lookup any target associated with each item and store its cmTarget pointer. Use the cmLinkItem class to hold the name and pointer together. Update client sites to use the pre-stored lookup result instead of looking up the target name again. Create a cmTarget::LookupLinkItems helper method to handle the lookup. Since lookups are now moving from cmComputeLinkDepends::AddLinkEntries to cmTarget::LookupLinkItems, move use of CheckCMP0004 to the latter. This drops use of CheckCMP0004 from entries added for _LIB_DEPENDS variables by cmComputeLinkDepends::AddVarLinkEntries, but I do not think that use was intentional originally anyway.
* Fix scope of transitive target name lookupsBrad King2014-06-231-2/+2
| | | | | | | | | | | In cmTarget, cmGeneratorTarget, and cmGeneratorExpressionEvaluator, fix target name lookups to occur in the cmMakefile context of the target that referenced the name, not the current 'head' target. The context matters for imported targets because they are directory-scoped instead of globally unique. We already do this in cmComputeLinkDepends and cmComputeTargetDepends. Extend the InterfaceLibrary test with an example covering this behavior.
* cmTarget: Constify GetTransitivePropertyTargets resultsBrad King2014-06-231-5/+6
| | | | Populate a vector of "cmTarget const*" instead of "cmTarget*".
* cmTarget: Remove 'head' argument from GetLinkImplementationBrad King2014-06-231-2/+1
| | | | | | | | | | | | | Many of the 'head' arguments added by commit v2.8.11~289^2~1 (Make linking APIs aware of 'head' target, 2013-01-04) turned out not to be needed. The "link implementation" of a target never needs to be computed with anything but itself as the 'head' target (except for CMP0022 OLD behavior because then it is the link interface). Remove the unused 'head' target paths. Add "internal" versions of cmTarget::GetDirectLinkLibraries and GetLinkImplementationLibraries to support the CMP0022 OLD behavior without otherwise exposing the 'head' target option of these methods.
* regex: Search on strings where possibleBen Boeckel2014-06-091-4/+4
|
* regex: Use static regexs where possibleBen Boeckel2014-06-091-8/+4
| | | | | Rather than declaring and compiling a constant regex every time a chunk of code is executed, build the regex once.