summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
|
* AppendProperty: convert value param to std::stringVitaly Stakhovsky2020-01-251-1/+1
|
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-2/+2
|
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-2/+3
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-2/+1
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* Source sweep: Replace std::ostringstream when used with a single appendSebastian Holtermann2019-08-231-4/+1
| | | | | | | This replaces `std::ostringstream`, when it is written to only once. If the single written argument was numeric, `std::to_string` is used instead. Otherwise, the single written argument is used directly instead of the `std::ostringstream::str()` invocation.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* cmCommand refactor: cmMacroCommandGabor Bencze2019-08-201-4/+7
|
* cmFunctionBlocker: Recycle functionsRegina Pfeifer2019-07-311-4/+4
|
* cmFunctionBlocker: Move check for matching argsRegina Pfeifer2019-07-301-16/+9
|
* cmFunctionBlocker: Move common logic to baseRegina Pfeifer2019-07-301-29/+6
|
* cm*FunctionBlocker: Extract function ReplayRegina Pfeifer2019-07-301-12/+20
|
* cm*FunctionBlocker: Move to source fileRegina Pfeifer2019-07-301-0/+14
|
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmState: Add scripted commands by valueRegina Pfeifer2019-07-211-36/+18
|
* cmCommand: deprecate functions GetMakefile and SetErrorDaniel Pfeifer2019-07-211-1/+1
| | | | | | | | | Replace the members for the Makefile and the Error with a cmExecutionStatus. Re-implement GetMakefile and SetError based on that. Both functions should be called directly on the cmExecutionStatus that is passed to InitialPass. This will help us make all Commands immutable and remove the need for cloning.
* cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptrSebastian Holtermann2019-07-171-3/+5
|
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-5/+7
|
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-1/+1
|
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
|
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-5/+0
|
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-2/+2
| | | | | | 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: Use emplaceRegina Pfeifer2019-01-171-1/+1
|
* Revise implementation of case-insensitive command namesFlorian Jacomme2018-05-221-3/+3
| | | | | | | | | | | | | | | | | | | | Store both the as-written and lower-case command names and use the latter to avoid case-insensitive string comparisons. With this I obtain 2-6% speed increase (on Windows) for the configure step with no significant changes in memory usage. A case-insensitive comparison is a lot slower than just calling `==` because the operator will use things like memcmp, so prefer the latter. The `cmSystemTools::LowerCase` function allocates a new string each time it is called, so before this change we were allocating in: * cmMakefile::Configure two times for each function (to look for `cmake_minimum_required` and `project`) * cmMakefile::ExecuteCommand twice by function by calling cmState::GetCommand and copying the name Now we are only allocating once by function instead of four.
* cmMacroCommand: Fix format string to match type of argumentjrp20142018-04-051-1/+1
|
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+2
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-4/+4
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-11/+9
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* cmCommand: remove unused methods from interface and all implementationsDaniel Pfeifer2017-05-111-10/+0
|
* cmState: introduce method for adding scripted commandsDaniel Pfeifer2017-05-111-4/+1
|
* Merge topic 'dead-code-removal'Brad King2017-05-111-3/+3
|\ | | | | | | | | | | | | | | | | fdd341eb cmFindCommon: remove unused function SetMakefile 67a8d907 cmExecutionStatus: Remove arguments from setters 0c519c70 bootstrap: Remove leftovers from cmBootstrapCommands Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !821
| * cmExecutionStatus: Remove arguments from settersDaniel Pfeifer2017-05-091-3/+3
| | | | | | | | | | The setters are only used to set boolean values. The values are never reset individually.
* | cmCommand: remove IsScriptableDaniel Pfeifer2017-05-081-5/+0
|/
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-1/+0
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+7
|
* Merge topic 'remove-cmobject-uses'Brad King2016-10-241-7/+2
|\ | | | | | | | | | | | | | | | | 2214011f Make cmCPackGenerator not inherit from cmObject 7f9a8d53 Make cmCPackGeneratorFactory not inherit from cmObject fb0b087c Make cmCTestGenericHandler not inherit from cmObject 2169b0fa Make cmCPackLog not inherit from cmObject 9855ebf1 Make cmCommand not inherit from cmObject
| * Make cmCommand not inherit from cmObjectDaniel Pfeifer2016-10-221-7/+2
| |
* | Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+2
|/
* 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.
* Avoid else after returnDaniel Pfeifer2016-09-161-3/+2
|
* use empty method to check for emptynessDaniel Pfeifer2016-09-151-1/+1
|
* cmMakefile: Restore nested error logic use of cmExecutionStatusBrad King2016-09-061-2/+2
| | | | | | | | | | | | | | Since commit 14a8d61f (cmMakefile: Port nested error logic away from cmExecutionStatus) we fail to continue processing function and macro bodies after non-fatal errors. A non-fatal error should not stop foreach loops, macro bodies, nested bodies, or the outer script. Add a test covering these cases, and revert the change to fix them. Also revert commit 2af853de (cmMakefile: Simplify IssueMessage implementation) because the assertion it added (which was removed by the above commit and is restored by reverting it) is incorrect. We do have code paths that call cmMakefile::IssueMessage with an empty execution stack, such as in CheckForUnusedVariables's LogUnused call.
* cmMakefile: Port nested error logic away from cmExecutionStatusStephen Kelly2016-08-251-2/+2
| | | | It is no longer needed.
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-8/+9
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-82/+54
| | | | | | | | | | | | | 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.
* 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>
* Remove temporary allocations in cmMacroHelper::InvokeInitialPass.Milian Wolff2016-01-201-9/+7
| | | | | | | | This code used to convert std::string's to raw C strings only to put that back into a std::string. This patch thus removes ~70k temporary allocations when running the CMake daemon on KDevelop. This hotspot was found with heaptrack.
* cmAlgorithms: Rename cmRange to cmMakeRange.Stephen Kelly2015-07-221-1/+1
|
* cmMakefile: Remove special handling of MACROS property.Stephen Kelly2015-07-191-1/+1
|