1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-16 17:03:54 +08:00

282 Commits

Author SHA1 Message Date
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
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