summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmCryptoHash: prefer to cmSystemTools::ComputeFileHashBen Boeckel2023-08-081-5/+3
|
* Merge topic 'msvc-embed-manifest-direct'Brad King2023-07-071-0/+20
|\ | | | | | | | | | | | | | | 8a07bcc149 MSVC: Restore support for non-incremental linking without 'rc' in PATH Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8613
| * MSVC: Restore support for non-incremental linking without 'rc' in PATHBrad King2023-07-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 0b552eb877 (MSVC: Embed manifests directly for non-incremental vs_link_exe links, 2023-02-20, v3.27.0-rc1~438^2) we tell the MSVC `link` tool to embed manifests directly rather than running `mt` ourselves. However, `link` expects `rc` to be in the PATH when embedding manifests. Although that is normally true, some users prepare minimal environments and explicitly specify include and link directories for the Windows SDK. In such cases, `rc` is not in the PATH and is explicitly specified in `CMAKE_RC_COMPILER`. Restore support for such cases by explicitly adding the RC location to the end of the PATH. Fixes: #25047
* | cmUVProcessChain: Return output and error streams as file descriptorsKyle Edwards2023-06-141-8/+5
| |
* | cmUVProcessChain: Add Status::SpawnResult fieldKyle Edwards2023-06-081-6/+4
|/
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-3/+3
|
* Merge topic 'iwyu_errors'Brad King2023-04-261-3/+10
|\ | | | | | | | | | | | | | | fcacc319d9 IWYU: Return error code if user enables error reporting Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8406
| * IWYU: Return error code if user enables error reportingAshish Sadanandan2023-04-251-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously CMake ignored the return code from iwyu because old versions of the tool would exit with an error code even when no header include violations were detected. The iwyu project has since changed this behavior, so the tool no longer returns an error code unless the user enables error reporting via command line arguments. Behavior seen with iwyu version 0.19 Source file with missing includes: - Case 1: iwyu arguments: - return code: 0 - output: <report of all missing includes> - Case 2: iwyu arguments: `-Xiwyu --error` - return code: 1 - output: <report of all missing includes> Source file with no missing includes: - Case 1: iwyu arguments: - return code: 0 - output: `(/path/to/file.cc has correct #includes/fwd-decls)` - Case 2: iwyu arguments: `-Xiwyu --error` - return code: 0 - output: `(/path/to/file.cc has correct #includes/fwd-decls)` Teach CMake to return the iwyu return code if the user has invoked the tool with any of these command line arguments included: - `--error[=N]` - `--error_always[=N]` Fixes: #24066
* | CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-5/+6
|/
* MSVC: Embed manifests directly for non-incremental vs_link_exe linksAndrew Ng2023-02-231-21/+21
| | | | | | | | | | | | | | This avoids the need to separately execute `mt.exe` to perform the embedding of manifests into the output for non-incremental links. The primary motivation for this change is that this separate execution of `mt.exe` to embed manifests is known to cause intermittent failures due to AV/security scanning. The only change in behavior is that any linker generated manifest will no longer be output as a separate manifest file alongside the output file. Fixes: #24531
* cmake -E time: use C++11 chrono and better format outputscivision2023-02-151-19/+5
| | | | fixes #24415
* cmake: Add -E copy_directory_if_differentRobert Maynard2023-01-121-3/+8
| | | | Fixes #21584
* clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR propertyKyle Edwards2022-12-061-0/+6
| | | | Fixes: #21362
* cmake -E copy: Add support for -t argumentKyle Edwards2022-11-151-7/+50
| | | | Fixes: #23543
* Merge topic 'clang-tidy-prefer-p-option'Brad King2022-10-071-7/+19
|\ | | | | | | | | | | | | 3f4e0839c4 clang-tidy: Don't append compiler commands if using -p Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7753
| * clang-tidy: Don't append compiler commands if using -pCraig Scott2022-10-071-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cmSystemTools: Provide quiet link creation methodsBrad King2022-10-061-4/+3
|/ | | | Offer variants that let the caller handle error messages.
* cmake -E env: Add --modify flagAlex Reinking2022-08-171-3/+35
| | | | | | | | | | | | | | | | | | | | | | 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.
* MSVC: Recognize -XYZ as well as /XYZ when parsing MS tool command linesDubach, Joev2022-07-271-4/+9
| | | | Fixes: #23772
* clang-tidy: address `modernize-use-default-member-init` lintsBen Boeckel2022-05-241-4/+2
|
* cmake -E tar: Add --touch optionKasper Laudrup2022-03-231-1/+6
| | | | | | | | 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
* cmOutputConverter: Always set relative path top source and binary togetherBrad King2022-02-281-4/+2
| | | | | Refactor to set both at once so we have a single place in the code that knows both have been set.
* cmcmd: add end of options delimiter to cmake -E commandsPeter Würth2022-02-031-6/+17
| | | | | | | | | | | | | | | 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
* Source: Replace C headers with C++ onesRose2021-11-021-1/+0
| | | | In applicable areas only, of course.
* cmcmd: Write progress and tar errors directly to stderrBrad King2021-10-271-6/+4
| | | | | In these code paths, `cmSystemTools::Message` never has a callback set. Inline the non-callback implementation at call sites.
* bootstrap: Do not declare cmSystemTools functions that are not implementedBrad King2021-10-271-1/+5
| | | | Convert runtime error messages into compile-time errors.
* Source: fix many -Wmissing-prototypes warnings by marking functions staticSean McBride2021-10-251-2/+2
|
* Merge topic 'fix-ifdef-windows'Brad King2021-10-181-1/+1
|\ | | | | | | | | | | | | 40e73c5ac4 Source: Fix typo in _WIN32 preprocessor checks Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6631
| * Source: Fix typo in _WIN32 preprocessor checksBrad King2021-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | 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
| * Merge topic 'cmake-E-cat-binary' into release-3.19Brad King2020-10-151-9/+15
| |\ | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Move helpers functions from cmStringAlgorithms.h to cmValue.hMarc Chevrier2021-09-211-0/+1
| | | | | | | | | | | | | | | Helpers functions related to cmValue semantic are now part of cmValue.h header.
* | | cmake: -E cat stops when an empty file is encounteredJohnny Jazeix2021-09-181-0/+2
| | | | | | | | | | | | Fixes: #22652
* | | LINK_WHAT_YOU_USE feature: externalize configurationMarc Chevrier2021-07-091-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | cmTransformDepfile: Add support for MSBuild AdditionalInputs formatBrad King2021-06-091-0/+2
| | |
* | | cmake_transform_depfile: Remove unused incomplete vstlog supportBrad King2021-06-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | cmOutputConverter: Adopt relative path conversion helpersBrad King2021-05-171-4/+12
| | | | | | | | | | | | Move them up from cmLocalGenerator and out of cmStateDirectory.
* | | Windows: Use real artifact versioning symlinks if possibleGeorg Schwab2021-05-101-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Source: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-2/+2
| | |
* | | Xcode: Add support of DEPFILE for add_custom_command, part 2Marc Chevrier2021-04-171-0/+2
| | | | | | | | | | | | | | | | | | This MR extend the support of 'DEPFILE' to buildsystem version 1. Issue: #20286
* | | cmcmd: Improve error message from cmake_symlink_{library,executable}Brad King2021-04-151-8/+15
| | |
* | | Update CMake code using KWSys to account for Status return valuesBrad King2021-04-141-1/+1
| | | | | | | | | | | | | | | | | | 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.
* | | Source: Reduce c_str() usagevvs314152021-03-131-10/+10
| | |
* | | bindexplib: remove stray debugging output when using llvm-nmBrad King2021-02-181-1/+0
| | | | | | | | | | | | | | | | | | 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).
* | | clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-2/+2
| | |
* | | Ninja: add_custom_command(DEPFILE): Ensure dependencies consistencyMarc Chevrier2021-01-191-7/+29
| | | | | | | | | | | | Fixes: #21694
* | | Makefile dependencies: ensure long paths are used on WindowsMarc Chevrier2021-01-091-5/+4
| | |
* | | Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-2/+2
| | | | | | | | | | | | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* | | Makefiles: Add support of DEPFILE for add_custom_commandMarc Chevrier2020-12-231-0/+2
| | | | | | | | | | | | | | | Issue: #20286 Fixes: #21415
* | | Makefiles Generators: use compiler for dependencies generationMarc Chevrier2020-11-291-28/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Ninja: Exclude unused dyndep features during CMake bootstrapBrad King2020-11-161-1/+1
| | |