1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-18 01:38:44 +08:00

282 Commits

Author SHA1 Message Date
Alex Turbov
8e3a65d963
Refactor: Avoid std::endl where it's not necessary (part 3)
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.
2020-03-24 21:33:33 +08:00
Rolf Eike Beer
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Rolf Eike Beer
bfb69f9543 replace "substr(0, xx) ==" with cmHasPrefix() 2020-03-23 20:19:26 +01:00
Thomas Bernard
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc
llvm-rc requires preprocessed rc files. The CMake command line tool
cmake_llvm_rc enables channing the preprocessor call and the resource
compiler and make this appear as single compilation step.

When llvm-rc is detected as resource compiler, the RC compilation step
is set to use this command.
2020-02-04 08:19:12 -05:00
Marc Chevrier
a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +01:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Marc Chevrier
36c8cae2e8 cmLocalGenerator: modernize memory management 2019-12-10 00:24:06 +01:00
Isuru Fernando
5ff1d7bd90 Add support for WINDOWS_EXPORT_ALL_SYMBOLS when cross-compiling to Windows
Implement `__create_def` using `llvm-nm` (when given as `CMAKE_NM`).
2019-12-06 09:30:25 -05:00
Johnny Jazeix
5239fc5c75 cmake -E: Add rm with improved semantics over remove and remove_directory 2019-11-13 18:02:18 -05:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
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.
2019-10-01 12:26:36 -04:00
Sebastian Holtermann
6bd40ccf84 Autogen: Make cmQtAutoMocUic a free function 2019-09-29 00:07:32 +02:00
Sebastian Holtermann
e0e9be3d57 Autogen: Make cmQtAutoRcc a free function 2019-09-29 00:07:32 +02:00
Sebastian Holtermann
820962edc9 Autogen: Refactor json info file reading interface 2019-09-29 00:07:32 +02:00
Sebastian Holtermann
881e3cfbf9 Autogen: Variable renames and cleanups 2019-09-25 10:31:06 +02:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Regina Pfeifer
d25a5a7ec9 clang-tidy: modernize-use-auto
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.
2019-09-10 22:21:41 +02:00
Daniel Eiband
ff5028c531 Windows: Prevent auto exports to be regenerated on every build
Check modified time stamps of input files against an existing exports file
before generating the auto exports.

Fixes: #19650
2019-09-09 15:43:15 +02:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Brad King
4684e64c84 Merge topic 'clang-ipo-support'
dca9c33abc Tests: Remove old IPO test
c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm
079b8e2916 Clang: prefer lld-link over link.exe
6e3655db2c Clang: add LTO support for GNU-command line clang on windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3527
2019-09-03 09:39:03 -04:00
Zsolt Parragi
c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm 2019-08-30 11:30:38 -04:00
Brad King
a38965db9a Merge topic 'remove_directory-symlink'
e6c9a8bac3 cmake: Teach -E remove_directory to remove directory symlinks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3738
2019-08-30 10:38:25 -04:00
Jon Chronopoulos
e6c9a8bac3 cmake: Teach -E remove_directory to remove directory symlinks
If the argument to `remove_directory` is a symlink to a directory,
remove the symlink instead.

Issue: #19533
2019-08-30 10:37:30 -04:00
Sebastian Holtermann
aaf59120bf Source sweep: Replace cmExpandList with the shorter cmExpandedList
This replaces the code pattern
```
std::vector<std::string> args;
cmExpandList(valueStr, args, ...)
```
with
```
std::vector<std::string> args = cmExpandedList(valueStr, ...)
```
2019-08-23 17:07:49 +02:00
Sebastian Holtermann
9b334397f5 Source sweep: Use cmStrCat for string concatenation
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)`
2019-08-22 16:38:10 +02:00
Brad King
337be1507d Merge topic 'isolate-declarations'
d331021255 clang-tidy: isolate declarations for readability

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3704
2019-08-22 10:23:34 -04:00
Brad King
bfe0ea2d98 Merge topic 'cm-contains'
2dfc52675c cmAlgorithms: Add cmContains

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3700
2019-08-21 11:52:06 -04:00
Regina Pfeifer
d331021255 clang-tidy: isolate declarations for readability 2019-08-21 00:20:49 +02:00
Regina Pfeifer
2dfc52675c cmAlgorithms: Add cmContains
Also, use the new function where applicable.
2019-08-19 20:01:39 +02:00
Sebastian Holtermann
20e580be01 Source sweep: Use cmIsOn instead of cmSystemTools::IsOn
This replaces invocations of

- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
2019-08-17 12:14:14 +02:00
Sebastian Holtermann
f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument 2019-08-14 16:33:20 +02:00
Kitware Robot
54e9d38c28 Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP 2019-08-09 10:41:44 -04:00
Sebastian Holtermann
f71f7ce3f0 cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Kyle Edwards
b8828ecbba cmake -E: Add true and false commands 2019-07-11 13:41:30 -04:00
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
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.
2019-07-10 11:48:56 -04:00
Brad King
6696855f72 cmake: Simplify implementation of -E capabilities
The `cmake -E capabilities` command-line tool is implemented only in a
full-featured (non-bootstrap) CMake, and server mode is now always
available in this case.
2019-06-07 11:08:38 -04:00
John Freeman
07a80c7002 cmake: Teach -E remove_directory to remove multiple directories
The `make_directory` command can make multiple directories in a single
invocation.  Make `remove_directory` mirror that behavior.
2019-06-03 14:20:00 -04:00
Brad King
6e8acc51a5 Merge topic 'string-tar'
57cedb18c0 cmSystemTools: std::string parameters for tar functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3392
2019-05-30 09:57:11 -04:00
Brad King
05af1770a0 Merge topic 'tar-zstd-compression'
53cb1f2d04 cmake: Teach cmake -E tar command, Zstandard compression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3357
2019-05-30 09:39:35 -04:00
Vitaly Stakhovsky
57cedb18c0 cmSystemTools: std::string parameters for tar functions 2019-05-29 09:56:08 -04:00
Brad King
4ec2b99941 Merge topic 'selective-tar-extracting-and-listing'
c8e217e0a7 cmake: tar: Allow selective extracting and listing of archives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3342
2019-05-24 10:43:14 -04:00
Sebastian Holtermann
006229278b Use cmAppend to append ranges to std::vector instances 2019-05-23 16:19:49 +02:00
Bartosz Kosiorek
c8e217e0a7 cmake: tar: Allow selective extracting and listing of archives 2019-05-23 10:08:22 -04:00
Bartosz Kosiorek
53cb1f2d04 cmake: Teach cmake -E tar command, Zstandard compression
Fixes #18657
2019-05-22 03:46:55 +02:00
Sebastian Holtermann
a3f062091f Autogen: Rename cmQtAutoGeneratorMocUic class to cmQtAutoMocUic
The class name `cmQtAutoGeneratorMocUic` is long and cumbersome.  This renames
it to `cmQtAutoMocUic`.
2019-04-15 16:07:13 +02:00
Sebastian Holtermann
7b98a6eb68 Autogen: Rename cmQtAutoGeneratorRcc to cmQtAutoRcc
The class name `cmQtAutoGeneratorRcc` is long and cumbersome.  This shortens
it to `cmQtAutoRcc`.
2019-04-06 17:37:12 +02:00
Brad King
29802ed272 Merge topic 'refactor-cmcmd'
f13aef4de5 cmcmd: Modernize for loops with cmMakeRange
e9bbfdd9a1 cmcmd: Pass args vector by const&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3168
2019-04-01 10:47:13 -04:00
Artur Ryt
2d66567dca Modernize: Prefer .substr in place of .c_str() + int
A lot of temporary/local strings were created out of C-strings
substr can utilize current string size, so in theory be a little
more efficient.
2019-03-30 16:15:05 +01:00
Artur Ryt
f13aef4de5 cmcmd: Modernize for loops with cmMakeRange
Also minor loop variable renaming
2019-03-30 15:39:45 +01:00
Artur Ryt
e9bbfdd9a1 cmcmd: Pass args vector by const& 2019-03-30 15:34:59 +01:00
Bartosz Kosiorek
ea9a2c1759 cmake: tar: Parse 'cmake -E tar' arguments 2019-03-20 09:28:49 -04:00