summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsC.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Rename cmProp in cmValueMarc Chevrier2021-09-211-3/+3
|
* cmLocalGenerator: Factor out relative path conversion helpersBrad King2021-05-131-5/+2
| | | | | | Most calls to `MaybeConvertToRelativePath` use one of our common work directories (e.g. top of the build tree) as the local path. Add helpers for each of the common cases to simplify and clarify call sites.
* cmDepends: merge dependers of depend makefileKai Wang2021-01-051-9/+22
| | | | | | | | | | | Since one depender has multiple dependees, depend makefile generated same depender line by line, to reduce file size and refine make file parse speed, merge same dependers to one. And add a testcase for large depend.make which generated source file includes 20000 header files and run build and incremental build Signed-off-by: Wangkai <wangkai86@huawei.com> Signed-off-by: Zhaoyingdong <zhaoyingdong@huawei.com>
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-4/+5
|
* cmMakefile: add GetDefExpandList() that splits value into std::vectorVitaly Stakhovsky2020-05-301-3/+1
| | | | Combines cmMakefile:GetDefinition() and cmExpandList()
* Makefiles: Factor out makefile target path escaping and quotingBrad King2020-04-151-2/+2
| | | | | | | | Code paths that write makefile target paths use a combination of `cmSystemTools::ConvertToOutputPath` and `cmMakeSafe`. Some were missing the latter. Wrap these two steps up into a dedicated `ConvertToMakefilePath` method provided on both the local and global generators.
* cmDepends: Update types to always use a Makefile generatorBrad King2020-04-131-3/+4
| | | | | | We only use these classes with a `cmLocalUnixMakefileGenerator3`. Construct using that type instead of just `cmLocalGenerator` so that the Makefile-specific methods are available.
* Merge topic 'cleanup-endls-2'Brad King2020-03-261-9/+9
|\ | | | | | | | | | | | | 1e4b5c7d09 Refactor: Avoid `std::endl` where it's not necessary (part 2) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4514
| * Refactor: Avoid `std::endl` where it's not necessary (part 2)Alex Turbov2020-03-241-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
* | replace "std::string::find(x) == 0" with cmHasPrefix()Rolf Eike Beer2020-03-231-4/+4
|/
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmDependsC: remove cmDeleteAll callTushar Maheshwari2019-09-201-12/+8
|
* 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: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-1/+2
|
* cmDepends: Define DependencyMap instead of DependencyVectorSebastian Holtermann2019-03-271-5/+3
| | | | | | | | | | | | | In `cmDepends` use `typedef std::map<std::string, std::vector<std::string>> DependencyMap` instead of defining a `class DependencyVector : public std::vector<std::string>` and using it in `std::map<std::string, DependencyVector>`. Since `std::map<std::string, std::vector<std::string>>` is used in various other places, we now reuse all of it's auto generated methods. This doesn't happen when we use `DependencyVector` in a `std::map`, because it is a different class than `std::vector<std::string>`.
* Replace use of CollapseCombinedPath with CollapseFullPathBrad King2019-03-191-2/+2
| | | | | | | | | | | `CollapseCombinedPath` was introduced by commit 551d3343cd (cmDependsC: Collapse relative include paths, 2013-06-19, v2.8.12~237^2) where the existing `CollapseFullPath` should have been used instead. Then its use proliferated slightly. Since `CollapseCombinedPath` is less widely used and less robust (see issue #19049), use `CollapseFullPath` everywhere instead. Issue: #19050
* cmDependsC: Read cache file modification time only onceSebastian Holtermann2019-03-181-4/+8
| | | | | | Using cmFileTime to store and compare file times in cmDependsC allows us to read the cache file modification time only once instead of over and over again for each comparison.
* cmDependsC: Use faster cmSystemTools::FileTimeCompareSebastian Holtermann2019-03-131-3/+2
| | | | | | The file stat caching feature of the local cmFileTimeComparison instance is unused in the addressed context. To avoid the allocation and initialization overhead of cmFileTimeComparison use cmSystemTools::FileTimeCompare instead.
* cmDependsC: Use auto for long type namesSebastian Holtermann2019-03-121-3/+2
|
* cmDependsC: Remove useless string preallocation artifactSebastian Holtermann2019-03-121-13/+6
|
* cmSystemTools::Error: consolidate parameters into single std::stringVitaly Stakhovsky2019-02-201-2/+1
|
* Merge topic 'tidy-use-equals-default'Brad King2019-01-291-3/+1
|\ | | | | | | | | | | | | | | | | 094f01d0f0 cleanup: Prefer compiler provided special member functions 55671b41d2 clang-tidy: Use `= default` Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Merge-request: !2841
| * 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 `{}`).
* | Merge topic 'cmoutputconverter-simplify'Brad King2019-01-291-2/+4
|\ \ | | | | | | | | | | | | | | | | | | b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2831
| * | cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.Bruno Manganelli2019-01-271-2/+4
| | |
* | | cmFileTimeComparison: use std::string argumentsVitaly Stakhovsky2019-01-281-2/+1
| |/ |/|
* | cmDepends: all members accept std::string argumentsVitaly Stakhovsky2019-01-191-9/+9
|/ | | | | | Most `const char*` arguments converted to `const std::string&` in `cmDepends` and derived classes. In addition performed minor code cleanup.
* clang-tidy: Use default member initializationRegina Pfeifer2018-12-151-1/+0
|
* Remove unnecessary c_str() in RegularExpression::find callsVitaly Stakhovsky2018-08-071-4/+4
|
* Makefile: Restore use of dependency scanning cachetsecer harry2018-03-201-3/+8
| | | | | | | | | | | | | | | Since commit v2.8.0~27 (Major optimization of C/C++ dependency scanning, 2009-09-23) our `VaildDeps` cache of `depend.internal` content is supposed to avoid re-scanning dependencies of object files whose dependencies have not changed. However, this was broken by changes to `cmDependsC::WriteDependencies` by commit v3.1.0-rc1~272^2~1 (cmDepends: Refactor object file path conversion, 2014-07-22). The object file path written to `depend.internal` was changed to a relative path, but the lookup in the `ValidDeps` cache of that information was not updated too. Therefore the cache is not used. Fix the object file path used for the `ValidDeps` lookup to restore the original optimization.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-13/+10
| | | | | | | | | | * 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.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-40/+27
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Replace C-style castsDaniel Pfeifer2017-08-271-1/+1
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-5/+5
|
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-1/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-2/+2
|
* 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'
* UseSWIG: Automatically scan dependencies of SWIG files for MakefilesAlexey Sokolov2017-01-101-2/+2
| | | | Issue: #4147
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-4/+3
|
* 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.
* Convert: Move access to BinaryDirectory out of loopsStephen Kelly2016-09-191-9/+7
|
* Convert: Inline HOME_OUTPUT MAKERULE conversionStephen Kelly2016-09-191-3/+5
|
* Convert: Inline MAKERULE conversionsStephen Kelly2016-09-191-2/+1
| | | | This is a trivial use of a static method.
* Convert: Avoid HOME_OUTPUT enum when converting to relative pathsStephen Kelly2016-09-191-1/+1
|
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-2/+3
|
* Convert: Replace trivial conversion with new methodStephen Kelly2016-08-271-2/+2
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-5/+5
|
* Add missing braces around statements.Daniel Pfeifer2016-06-101-1/+2
| | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.