1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-20 03:38:05 +08:00

320 Commits

Author SHA1 Message Date
Brad King
ec1b6157cb Update CMake code using KWSys to account for Status return values
KWSys as of 2021-04-14 changed the return type of `SystemTools`
operations from `bool` to `Status`.  Update our call sites.
This may improve error reporting accuracy in a few places.
2021-04-14 13:14:09 -04:00
vvs31415
12624ebd7e Source: Reduce c_str() usage 2021-03-13 07:36:07 -05:00
Brad King
06e5077688 bindexplib: remove stray debugging output when using llvm-nm
Remove a debugging message left by commit c856d4556b (bindexplib:
supporting llvm bitcode formats using llvm-nm, 2019-08-13,
v3.16.0-rc1~161^2~1).
2021-02-18 09:37:21 -05:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Marc Chevrier
b5c2163293 Ninja: add_custom_command(DEPFILE): Ensure dependencies consistency
Fixes: #21694
2021-01-19 13:17:14 +01:00
Marc Chevrier
8ec7408d74 Makefile dependencies: ensure long paths are used on Windows 2021-01-09 11:35:00 +01:00
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Marc Chevrier
cfd8a5ac1f Makefiles: Add support of DEPFILE for add_custom_command
Issue: #20286
Fixes: #21415
2020-12-23 15:47:46 +01:00
Marc Chevrier
2c71d051fa Makefiles Generators: use compiler for dependencies generation
Each source compilation generates a dependencies file. These dependencies
files are consolidated in one file per target. This consolidation is done
as part of command 'cmake -E cmake_depends` launched before evaluation of
makefile dependency graph.

The consolidation uses the same approach as `CMake` dependencies management.

Fixes: #21321
2020-11-29 15:25:42 +01:00
Brad King
fa18069ebd Ninja: Exclude unused dyndep features during CMake bootstrap 2020-11-16 11:42:40 -05:00
Orgad Shaneh
8e2eba6b4c MSVC: Suppress rc/mt/link output unless verbose is requested
Output like the following is typically not interesting at all:
LINK : program database F:\Project\Project.pdb missing; performing full link
   Creating library Project.lib and object Project.exp

Fixes #21422
2020-11-11 14:46:58 +02:00
Thomas Bernard
ea03f50842 llvm_rc: add llvm_rc option filter to correctly pick up all options
Fixes: #21315
2020-10-28 07:19:31 -04:00
Brad King
4f6fccd861 Merge topic 'remove-server-mode'
9952ee063a server: remove deprecated 'cmake -E server' mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5370
2020-10-15 08:31:47 -04:00
Brad King
9493532f80 Merge topic 'cmake-E-cat-binary'
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:51 -04:00
Brad King
b1d9a25f35 Merge topic 'cmake-E-cat-binary' into release-3.19
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:50 -04:00
Brad King
9952ee063a server: remove deprecated 'cmake -E server' mode
The server mode has been deprecated since commit 996e1885c4 (server:
deprecate in favor of the file-api, 2019-04-19, v3.15.0-rc1~198^2).
Clients should now be using the file-api.  Remove the server mode.
2020-10-14 16:41:50 -04:00
Johnny Jazeix
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
Reset `std::cout` to write in binary mode with no encoding conversions.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21295
2020-10-14 12:08:07 -04:00
Brad King
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management 2020-10-14 12:08:06 -04:00
Kyle Edwards
b2c14bc774 cmake -E: Add cmake_transform_depfile internal command 2020-10-13 10:18:02 -04:00
Brad King
a218d67f50 Merge topic 'bootstrap-ninja'
491dddfbde Bootstrap: Add support for Ninja

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3652
2020-08-11 08:57:00 -04:00
Kyle Edwards
491dddfbde Bootstrap: Add support for Ninja 2020-08-10 14:40:17 -04:00
Thomas Bernard
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict 2020-08-07 11:47:15 -04:00
Sibi Siddharthan
2fad00940d cmake: Add -E create_hardlink
Fixes: #20950
Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
2020-07-15 20:22:04 +05:30
Vitaly Stakhovsky
8ef18e8525 Clean a few string conversions 2020-07-09 09:42:00 -04:00
Asit Dhal
b5b6075522 cmake: add dedicated error for -E compare_files invalid arguments
Return 2 when user provides invalid arguments

Fixes: #20815
2020-06-15 12:39:37 -04:00
Asit Dhal
a7d44d55ae cmake: remove -E compare_files error message if files differ
It is not an error for the files to be different.

Fixes: #20803
2020-06-10 07:23:10 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Brad King
d9eb9e785e Merge topic 'win-user-manifest-rc'
7ca13e04fa Windows: Merge user-provided manifests into compiled resource

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4484
2020-04-22 09:15:59 -04:00
Kenney Phillis
7ca13e04fa Windows: Merge user-provided manifests into compiled resource
Previously we merged user-provided manifests only into the manifest file
given to the linker.  Merge them into the manifest file that is compiled
as a resource too.
2020-04-21 08:10:45 -04:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Kyle Edwards
5f20e85412 Merge topic 'cat_cmd_20557'
a625f30785 cmake -E: add cat command.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4600
2020-04-16 11:35:55 -04:00
Johnny Jazeix
a625f30785 cmake -E: add cat command.
Concatenate files and print on the standard output.

FIXES: #20557
2020-04-15 20:56:56 +02:00
Ben Boeckel
f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Brad King
c0438d272d Merge topic 'llvm-rc-include-path'
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
2020-04-07 08:00:45 -04:00
Thomas Bernard
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly
preprocess RC source files and then compile separately without -I flags.
This broke cases where the RC source references data files adjacent to
itself or in the include path.

This change adds the expansion of the include paths when calling the
llvm-rc in order for the resource files to be picked up correctly by
llvm-rc.  Since the RC compiled file is first preprocessed, the file
being compiled by llvm-rc resides in the build directory. In order for
llvm-rc to find the resource data specified relative to the .rc file
being compiled, the source file path is preppended in the include list
so that the original source path takes priority over all the other
includes paths specified.

A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include
directive work properly for llvm-rc. Checks on the rc.exe showed that
the syntax change doesn't affect it's proper operation.

Fixes: #20529
2020-04-06 21:19:12 +02:00
Brad King
a88b27bfc7 Merge topic 'llvm-rc-stderr'
dc93cbb0d8 llvm-rc: Print stderr output when calling tools through cmake_llvm_rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4525
2020-03-27 07:39:30 -04:00
Brad King
4b266927c7 Merge topic 'cleanup-endls-3'
8e3a65d963 Refactor: Avoid `std::endl` where it's not necessary (part 3)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4517
2020-03-26 09:19:31 -04:00
Thomas Bernard
dc93cbb0d8 llvm-rc: Print stderr output when calling tools through cmake_llvm_rc
The stored error pipe is output if the program fails.

Fixes: #20494
2020-03-26 07:59:55 -04:00
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