1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-15 16:39:26 +08:00

296 Commits

Author SHA1 Message Date
Kyle Edwards
8d9069e5b6 cmake -E copy: Add support for -t argument
Fixes: #23543
2022-11-15 07:47:07 -05:00
Brad King
a07be2ffd1 Merge topic 'clang-tidy-prefer-p-option'
3f4e0839c4 clang-tidy: Don't append compiler commands if using -p

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7753
2022-10-07 11:20:03 -04:00
Craig Scott
3f4e0839c4 clang-tidy: Don't append compiler commands if using -p
When the -p option is given to clang-tidy, it doesn't need the compile
command line to be appended. It can get everything it needs from the
compile_commands.json file in the directory specified with the -p option.
When the compiler being used is not the system default compiler,
clang-tidy has been observed to pick up the wrong headers when the
compiler command line is given, but not if only the -p option is used.
Therefore, don't append the compiler command line if -p is present in
the <LANG>_CLANG_TIDY target property.

Fixes: #24017
2022-10-07 10:33:32 -04:00
Brad King
aba48bd6ac cmSystemTools: Provide quiet link creation methods
Offer variants that let the caller handle error messages.
2022-10-06 14:38:53 -04:00
Alex Reinking
c9d70a7cc3 cmake -E env: Add --modify flag
When `cmake -E env` is given the `--modify` flag, try to parse the
following argument as an `ENVIRONMENT_MODIFICATION` operation and apply
it to the environment.

This generalizes `--unset=`:

1.  When implementing `ENVIRONMENT_MODIFICATION` features for other CMake
    commands, the `MYVAR=OP:VALUE` strings do not need to be translated
    to OP-specific flags.
2.  This provides a natural and consistent extension point to introduce
    new operations without introducing very many flags.
3.  Users need to learn only one syntax to access the same functionality.

There is one difference between the behavior here as compared to CTest's
interpretation of the `ENVIRONMENT_MODIFICATION` test property.
The `MYVAR=reset:` command when run in `cmake -E env` will reset `MYVAR`
to whatever its value was when `cmake -E env` launched, rather than try
to checkpoint after plain `MYVAR=VALUE` options.  This makes `MYVAR=VALUE`
and `--modify MYVAR=set:VALUE` semantically equivalent.
2022-08-17 12:54:39 -04:00
Dubach, Joev
9dbcfb8fdd MSVC: Recognize -XYZ as well as /XYZ when parsing MS tool command lines
Fixes: #23772
2022-07-27 16:51:15 -04:00
Ben Boeckel
a5f8cbe8b1 clang-tidy: address modernize-use-default-member-init lints 2022-05-24 09:09:43 -04:00
Kasper Laudrup
0b7fd783f8 cmake -E tar: Add --touch option
Similar to GNU tar add a --touch option to the tar extract command to
skip extracting the timestamps from the files in the archive
effectively touching them as if they were just created.

Issue: #22746
2022-03-23 14:41:34 +01:00
Brad King
43416c48ed cmOutputConverter: Always set relative path top source and binary together
Refactor to set both at once so we have a single place in the code that
knows both have been set.
2022-02-28 10:25:18 -05:00
Peter Würth
b10930040d cmcmd: add end of options delimiter to cmake -E commands
Implements a -- delimiter, that indicates the end of options (starting
with a dash -) of a command and separates them from the subsequent
operands (positional arguments).

The following commands are affected:
- env: Implemented the -- delimiter.
- cat: The -- delimiter was already kind of considered, but its
  occurence did not stop the options parsing.
- rm: Here the command already implemented the -- delimiter as
  specified, but it was not documented.

Fixes #22970
2022-02-03 21:54:17 +01:00
Rose
6f4727aaa0 Source: Replace C headers with C++ ones
In applicable areas only, of course.
2021-11-02 14:45:29 -04:00
Brad King
4862f3b2c8 cmcmd: Write progress and tar errors directly to stderr
In these code paths, `cmSystemTools::Message` never has a callback
set.  Inline the non-callback implementation at call sites.
2021-10-27 12:58:29 -04:00
Brad King
efc6c23a47 bootstrap: Do not declare cmSystemTools functions that are not implemented
Convert runtime error messages into compile-time errors.
2021-10-27 12:58:02 -04:00
Sean McBride
1cf14f8c03 Source: fix many -Wmissing-prototypes warnings by marking functions static 2021-10-25 12:27:09 -04:00
Brad King
3c855b167f Merge topic 'fix-ifdef-windows'
40e73c5ac4 Source: Fix typo in _WIN32 preprocessor checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6631
2021-10-18 09:29:20 -04:00
Brad King
40e73c5ac4 Source: Fix typo in _WIN32 preprocessor checks
Since CMake's default compiler flags with MSVC include `-DWIN32` for
historical reasons, a few preprocessor conditions were accidentally
checking for `WIN32` instead of `_WIN32`.  The corresponding blocks
were left out when compiling official binaries for `cmake.org` because
we hard-code compiler flags without `-DWIN32`.

Fixes: #22764
2021-10-15 11:39:04 -04:00
Marc Chevrier
59ad7a1c24 Move helpers functions from cmStringAlgorithms.h to cmValue.h
Helpers functions related to cmValue semantic are now part of
cmValue.h header.
2021-09-21 18:11:00 +02:00
Johnny Jazeix
0b4a56e64b cmake: -E cat stops when an empty file is encountered
Fixes: #22652
2021-09-18 18:54:53 +02:00
Marc Chevrier
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.

Fixes: #20174
2021-07-09 14:50:50 +02:00
Brad King
7291f31254 cmTransformDepfile: Add support for MSBuild AdditionalInputs format 2021-06-09 10:09:58 -04:00
Brad King
f0e9d74a2d cmake_transform_depfile: Remove unused incomplete vstlog support
In commit b2c14bc774 (cmake -E: Add cmake_transform_depfile internal
command, 2020-10-02, v3.20.0-rc1~684^2~2) a partial implementation for
converting MSBuild "TLog" format files was added.  However, it is
unused and incomplete:

* Does not enforce absolute paths as TLog docs require.
* Does not upper-case paths as TLog docs recommend.
* The TLog format semantics are not equivalent to `out: in`.

Remove the unused TLog transform infrastructure to avoid confusion.

Issue: #20286
2021-06-02 07:41:05 -04:00
Brad King
8526756b61 cmOutputConverter: Adopt relative path conversion helpers
Move them up from cmLocalGenerator and out of cmStateDirectory.
2021-05-17 10:04:01 -04:00
Georg Schwab
d0c31cbff9 Windows: Use real artifact versioning symlinks if possible
When cross compiling from Windows to a platform that uses SONAMEs, real
symlinks are now created for the VERSION and SOVERSION links instead of
copies, if the user has the necessary privileges.

Fixes: #22128
2021-05-10 11:12:28 -04:00
Josef Angstenberger
5950e54325
Source: Fix typos and spelling in comments 2021-05-07 17:00:18 +02:00
Marc Chevrier
253aff6c94 Xcode: Add support of DEPFILE for add_custom_command, part 2
This MR extend the support of 'DEPFILE' to buildsystem version 1.

Issue: #20286
2021-04-17 11:05:26 +02:00
Brad King
79a2f1e22a cmcmd: Improve error message from cmake_symlink_{library,executable} 2021-04-15 12:40:37 -04:00
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