| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Combines cmMakefile:GetDefinition() and cmExpandList()
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
We only use these classes with a `cmLocalUnixMakefileGenerator3`.
Construct using that type instead of just `cmLocalGenerator` so
that the Makefile-specific methods are available.
|
|\
| |
| |
| |
| |
| |
| | |
1e4b5c7d09 Refactor: Avoid `std::endl` where it's not necessary (part 2)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4514
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>`.
|
|
|
|
|
|
|
|
|
|
|
| |
`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
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2831
|
| | | |
|
| |/
|/| |
|
|/
|
|
|
|
| |
Most `const char*` arguments converted to `const std::string&`
in `cmDepends` and derived classes.
In addition performed minor code cleanup.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
|
|
|
|
|
|
| |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'
|
|
|
|
| |
Issue: #4147
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This is a trivial use of a static method.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Apply fixits of clang-tidy's readability-braces-around-statements
checker.
|