summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.cxx
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-3/+1
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* clang-tidy: Pass by valueRegina Pfeifer2019-01-221-6/+5
|
* Source: Modernize for loops, add const modifiersVitaly Stakhovsky2018-12-311-9/+4
|
* Refactoring: introduce function to check if a string is a generator expressionMarc Chevrier2018-09-251-3/+3
|
* Fix transitive usage requirements through same-name imported targetsBrad King2018-09-101-2/+1
| | | | | | | | | | If two imported targets in different directories have the same name we should still be able to propagate transitive usage requirements from both. Fix the DAG checker to work with target pointers instead of target names since the pointers will not be duplicated even if the names are. Fixes: #18345
* genex: Simplify cmGeneratorExpressionInterpreterBrad King2018-09-071-6/+9
| | | | | | | | | 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-3/+3
| | | | Also remove unused overloads.
* EvaluateExpression() returns std::stringVitaly Stakhovsky2018-08-161-2/+2
|
* cmCompiledGeneratorExpression::Evaluate(): return const std::string&Vitaly Stakhovsky2018-08-091-6/+5
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Genex: Per-source $<COMPILE_LANGUAGE:...> supportMarc Chevrier2017-12-131-0/+16
| | | | Fixes: #17542
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-4/+4
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-3/+3
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-5/+4
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-3/+3
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | 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'
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-1/+2
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-3/+4
|
* 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-3/+5
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-1/+2
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-3/+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|'
* Improve string find: prefer character overloads.Daniel Pfeifer2016-05-241-2/+2
| | | | | Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-215/+147
| | | | | | | | | | | | | 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-16/+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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Genex: Port some access API to cmGeneratorTarget.Stephen Kelly2015-10-151-4/+4
|
* cmGeneratorExpression: Port interface to cmGeneratorTarget.Stephen Kelly2015-10-121-3/+3
|
* cmGeneratorExpression: Port to cmLocalGenerator.Stephen Kelly2015-10-121-5/+5
|
* Genex: Store a backtrace, not a pointer to one.Stephen Kelly2015-07-171-4/+2
| | | | | | | | | | 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.
* cmMakefile: Make cmListFileBacktrace default constructible.Stephen Kelly2015-06-021-1/+1
|
* Merge topic 'refactor-cmGeneratorExpression'Brad King2015-03-121-14/+13
|\ | | | | | | | | | | | | | | | | 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: Extend cmGeneratorExpressionContext constructor.Stephen Kelly2015-03-101-13/+4
| | | | | | | | Initialize the members in the appropriate place.
| * Genex: Extract an evaluateWithContext method.Stephen Kelly2015-03-101-12/+20
| | | | | | | | | | Make it easier to make modifications to the context before evaluating with it.
* | Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|/
* Genex: Add a COMPILE_LANGUAGE generator expression.Stephen Kelly2015-03-071-3/+7
|
* Convert raw loops to set member insert.Stephen Kelly2015-01-181-6/+2
|
* Use the cmDeleteAll algorithm instead of trivial raw loops.Stephen Kelly2015-01-131-9/+1
|
* cmGeneratorExpression: Remove unused header.Stephen Kelly2014-12-181-2/+0
|
* Fix some Clang -Wstring-conversion warningsSean McBride2014-12-121-1/+1
| | | | | Some false positives, but some flagged faulty asserts where the ! was inside the string instead of outside.
* file(GENERATE): Evaluate early to allow generating source filesStephen Kelly2014-11-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove borland workarounds.Stephen Kelly2014-10-151-8/+0
| | | | | CMake 3.0 is the last release to require to be able to build with Borland.
* Genex: Track whether an expression depends on the 'head' targetBrad King2014-07-211-0/+3
|
* regex: Use static regexs where possibleBen Boeckel2014-06-091-3/+2
| | | | | Rather than declaring and compiling a constant regex every time a chunk of code is executed, build the regex once.
* cmGeneratorExpression: Add workaround for Borland compilerBrad King2014-06-061-0/+8
|
* backtrace: Convert to local paths in IssueMessageBen Boeckel2014-06-051-1/+1
| | | | | This is the only place we care show the FilePath to the user, so defer the expensive relative path calculation until here.
* genex: remove the need for backtracesBen Boeckel2014-06-051-4/+4
| | | | | Rather than making dummy backtraces and passing them around, just make backtraces optional.
* Features: Add COMPILE_FEATURES generator expression.Stephen Kelly2014-05-211-0/+17
| | | | | | | | | | | | 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-1/+3
| | | | | | | | | | 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.