summaryrefslogtreecommitdiffstats
path: root/Source/cmForEachCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Rename cmProp in cmValueMarc Chevrier2021-09-211-1/+1
|
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-0/+1
| | | | | | To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
* foreach(): loop variables are only available in the loop scopeMarc Chevrier2021-04-281-10/+27
| | | | Fixes: #20553
* cmListFileCache: Make cmListFileFunction a shared pointerOleksandr Koval2020-10-011-1/+1
| | | | | Passing cmListFileFunction everywhere by-value involves big overhead. Now cmListFileFunction stores std::shared_ptr to the underlying data.
* Merge topic 'foreach-int-parse-range-check'Brad King2020-09-211-0/+6
|\ | | | | | | | | | | | | 0412b55b83 foreach: Fix crash parsing integer out of range Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5239
| * foreach: Fix crash parsing integer out of rangeBen McMorran2020-09-181-0/+6
| |
* | cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-4/+5
|/
* GetDefinition: avoid duplicate callsVitaly Stakhovsky2020-05-291-4/+4
|
* Merge topic 'stl-support'Brad King2020-05-011-2/+1
|\ | | | | | | | | | | | | 8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4689
| * Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
| |
* | IWYU: mark <cstddef> as neededBen Boeckel2020-04-291-1/+1
|/ | | | Newer IWYU is not seeing them as needed for `size_t`.
* foreach: Set fatal error on invalid rangeKyle Edwards2020-02-271-0/+1
| | | | Fixes: #20394
* foreach: Fix crash when parsing invalid integerKyle Edwards2020-02-271-6/+35
| | | | Fixes: #20393
* foreach: Allow multiple iteration variables for `ZIP_LIST` modeAlex Turbov2019-12-071-20/+87
|
* foreach: Introduce `IN ZIP_LISTS` modeAlex Turbov2019-12-011-27/+171
|
* Refactor: Modernize `foreach` code and fix some bugsAlex Turbov2019-11-061-70/+75
| | | | | | - fix the typo in `foreach` documentation - fix broken `foreach(... IN ITEMS ... LISTS ...)` - add tests of `foreach` for existed functionality and fixes
* 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
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-9/+6
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
|
* cmCommand refactor: cmForEachCommandGabor Bencze2019-08-201-12/+18
|
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-1/+2
|
* cmExecutionStatus: Remove function ClearRegina Pfeifer2019-08-061-2/+1
|
* cmFunctionBlocker: Recycle functionsRegina Pfeifer2019-07-311-3/+2
|
* cmFunctionBlocker: Move check for matching argsRegina Pfeifer2019-07-301-14/+8
|
* cmFunctionBlocker: Move common logic to baseRegina Pfeifer2019-07-301-36/+7
|
* cm*FunctionBlocker: Extract function ReplayRegina Pfeifer2019-07-301-38/+48
|
* cm*FunctionBlocker: Move to source fileRegina Pfeifer2019-07-301-0/+19
|
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-4/+4
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* 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-11/+11
|
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-2/+2
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
|
* Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-4/+2
| | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-1/+1
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-2/+2
| | | | Reduce the number of files relying on `cmake.h`.
* clang-tidy: fix warnings from version 7Regina Pfeifer2018-11-201-1/+1
| | | | | Fix some warnings that are new since clang-tidy version 4, and update `.clang-tidy` to suppress the rest.
* 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.
* cmForEachCommand: prevent leakageMatthias Maennich2017-10-301-2/+3
|
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-4/+5
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-2/+2
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* cmExecutionStatus: Remove arguments from settersDaniel Pfeifer2017-05-091-1/+1
| | | | | The setters are only used to set boolean values. The values are never reset individually.
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-2/+8
|
* Separate compilation for commands included in cmBootstrapCommands1Daniel 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
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-4/+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|'
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-125/+86
| | | | | | | | | | | | | 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-1/+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.