summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionParser.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+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-1/+2
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-135/+100
| | | | | | | | | | | | | 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.
* Replace 'foo.size() > 0' pattern with !foo.empty().Stephen Kelly2015-01-181-3/+3
|
* 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.
* 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]
* Genex: Fix segfault when parsing ends with parameter expectation.Stephen Kelly2013-08-131-1/+19
| | | | | | | The extendResult method expects a non-empty parameters vector, as assured by the normal case. Avoid calling the method when the parser finds an incomplete generator expression, but has already entered the state of expecting to find parameters.
* Genex: Don't segfault on $<FOO,>Stephen Kelly2012-11-271-1/+9
| | | | | | Treat the comma as part of the identifier here. It will later not resolve to a generator expression and the user gets a proper error message.
* GenEx: Add some more asserts to verify code-sanity.Stephen Kelly2012-10-171-0/+12
|
* GenEx: Break if there are no more commas in the containerStephen Kelly2012-10-171-0/+4
| | | | | This was causing an assert on Windows which has safety features for iterating past the end of the container.
* GenEx: Fix termination bugs in generator expression parser.Stephen Kelly2012-10-171-13/+24
| | | | | | | Content which is incomplete as a generator expression could cause segfaults by advancing an iterator beyond end() and dereferencing it. Such incomplete generator expressions should be treated as plain text instead.
* GenEx: Parse colon after arguments separator colon specially.Stephen Kelly2012-10-171-2/+9
| | | | | | The rationale is similar to that in commit b3d8f5da (GenEx: Parse comma after colon tokens specially, 2012-10-04), in that colon tokens should not be parsed as identifier-argument delimiters after the first colon.
* GenEx: Parse comma after colon tokens speciallyStephen Kelly2012-10-091-1/+7
| | | | | | | | | | | | | | | Otherwise the comma is treated as plain text by ParseContent. $<STREQUAL:,> should be valid and true. $<STREQUAL:,something> should be valid and false. $<STREQUAL:,,> should be non-valid as it is 3 parameters. $<STREQUAL:something,,> should be non-valid as it is 3 parameters. Additionally, this allows reporting the correct error for other expressions. For example $<TARGET_PROPERTY:,> should be invalid because it has an empty target and empty property. It shouldn't attempt to read the property ',' on the 'implicit this' target.
* GenEx: It is not an error to specify an empty parameterStephen Kelly2012-10-091-4/+0
| | | | This is allowed by the CONFIG and STREQUAL expressions.
* Handle colons as a special case in the generator expression parser.Stephen Kelly2012-09-211-0/+5
| | | | | | | | | | Like the special case for commas, this ensures that the colon only has special meaning as the delimiter between the identifier and the parameters of a particular expression, but constructs such as INCLUDE_DIRECTORIES "$<1:C:\foo>" are legal.
* cmGeneratorExpression: Re-write for multi-stage evaluationStephen Kelly2012-09-181-0/+235
The expressions may be parsed and then cached and evaluated multiple times. They are evaluated lazily so that literals such as ',' can be treated as universal parameter separators, and can be processed from results without appearing literally, and without interfering with the parsing/evaluation of the entire expression.