summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-5/+5
|
* Replace C-style castsDaniel Pfeifer2017-08-271-1/+1
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+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-13/+4
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-12/+11
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-141/+105
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-2/+2
| | | | | 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.
* 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.