summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Remove some c_str() calls.Stephen Kelly2014-03-111-1/+1
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-2/+2
|
* cmGeneratorExpression: Tokenize over stringsBen Boeckel2014-03-081-8/+8
|
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-1/+1
| | | | | | | | | | | 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.
* cmGeneratorExpression: Improve parsing in StripEmptyListElementsBen Boeckel2014-02-211-3/+10
| | | | | | The char-by-char parsing causes lots of reallocations which shouldn't be necessary. To improve this, fast-path strings without a semicolon, reserve space in the result, and insert into the result in chunks.
* Export: Prefix relative items with genexes in INSTALL_INTERFACE.Stephen Kelly2013-11-261-1/+1
| | | | | | | | | | | | | | Code such as target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include$<FOO>> ) should be treated as a relative directory, despite the genex, after the INSTALL_INTERFACE is stripped away. Previously, this would generate a relative directory on export, which would be an error on import, so no policy is needed.
* cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-3/+3
| | | | | | 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.
* Merge topic 'rename-genex-method'Brad King2013-10-071-3/+3
|\ | | | | | | | | cfae430 Genex: Rename cmGeneratorExpression::NeedsParsing to NeedsEvaluation
| * Genex: Rename cmGeneratorExpression::NeedsParsing to NeedsEvaluationStephen Kelly2013-08-291-3/+3
| |
* | Genex: Fix processing multiple include directories for relative pathsStephen Kelly2013-10-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Re-insert the semicolon which was removed during splitting. Commit d777b8e7 (Genex: Allow relative paths in INSTALL_INTERFACE., 2013-07-25) introduced the prefixItems method to allow relative paths in the argument of the INSTALL_INTERFACE expression. That method was buggy in that it did not re-introduce the semicolon separator in the result. This bug also affects paths which are already absolute in user code.
* | genex: Fix preprocessing with incomplete content (#14410).Stephen Kelly2013-09-131-4/+12
|/ | | | | | | | Similar incomplete generator expressions are already tested in the GeneratorExpression unit test, but those are executed with add_custom_target. The generator expressions in the include directories are run through the preprocessor, whereas the ones run through add_custom_target are not.