Commit Graph

53733 Commits

Author SHA1 Message Date
Brad King
00a3889c19 Merge topic 'ninja-multi-test-fix' into release-3.21
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6383
2021-07-26 09:36:49 -04:00
Brad King
98d813b92c Merge topic 'autouic-header-depends' into release-3.21
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
2021-07-26 09:34:51 -04:00
Brad King
2f7c4a788c Merge topic 'autogen-deps' into release-3.21
4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6381
2021-07-26 09:33:56 -04:00
Craig Scott
9d9d527513 Merge topic 'doc-ctest-output' into release-3.21
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00
Craig Scott
ba6d1947b6 Help: Add cross-references between test output size ctest variables 2021-07-26 21:08:45 +10:00
Craig Scott
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output 2021-07-25 21:37:29 +10:00
Kyle Edwards
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd 2021-07-23 13:22:59 -04:00
Joerg Bornemann
4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp
For an AUTOMOC'ed target foo, when depfiles are used, there are the
following dependencies:

foo_autogen -> foo_autogen/timestamp
foo_autogen/mocs_compilation.cpp -> foo_autogen/timestamp

The first is used to trigger AUTOGEN.
The second erroneously triggers a recompilation of
mocs_compilation.cpp when any source file of target foo is touched.

Remove the latter dependency and replace it with an order-only
dependency from foo_autogen/mocs_compilation.cpp to
foo_autogen_timestamp_deps.

That is achieved by making mocs_compilation.cpp or its
per-configuration variants byproduct(s) of the timestamp file.

Fixes: #22338
2021-07-23 15:47:28 +02:00
Brad King
c8f13bcb41 Merge topic 'gnu_c23' into release-3.21
d61bc4241d GNU: Correct C23 flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6376
2021-07-23 09:40:35 -04:00
Brad King
e06c60f7e9 Merge topic 'nmc-target-objects' into release-3.21
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6371
2021-07-23 09:39:25 -04:00
Brad King
8ea0691e62 Merge topic 'enable_language-CMP0126' into release-3.21
078ba4b2a4 Swift: Update test case to try CMP0126 NEW behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6375
2021-07-23 09:38:04 -04:00
Alexey Edelev
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files
We could not rely on .ui files when generating the ninja rules
for the generated UI header files. .ui files might be added to the
target sources but never processed by AUTOUIC afterward, since UI
header files are never included in a source code. Instead of adding
dependency rules based on the .ui files, this approach scans
non-generated source files for includes of the UI header files,
as AUTOUIC does. This gives the consistent set of UI header files
at configure time, that could be used to generate byproducts rules
for the AUTOUIC. Also, the path to the generated UI header file depends
not on the .ui file location but on the include line is used in source
files.

Fixes: #16776
2021-07-23 15:37:31 +02:00
Brad King
41e9953143 Merge topic 'iar-binutils' into release-3.21
5b9bfe738c IAR: Moved search logic to BinUtils.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6372
2021-07-23 09:27:28 -04:00
Jean-Marc Hengen
5b9bfe738c IAR: Moved search logic to BinUtils.
The search logic for the IAR linker, librarian and related tools is
moved from `Modules/Compiler/IAR-FindBinUtils.cmake` to
`Modules/CMakeFindBinUtils.cmake` by introducing an new elseif block
for the IAR toolchain.

The search logic was refactored to omit repeating itself.

Fixes: #22425
2021-07-23 14:34:26 +02:00
Raul Tambre
d61bc4241d GNU: Correct C23 flags
Non-final forms aren't supported yet, unlike C++23.
Seems I might've gotten confused due to that when I added these.

Fixes #22453.
2021-07-21 20:25:02 +03:00
Brad King
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
Since commit 2ae72ef74b (Xcode: Enable multi-arch TARGET_OBJECTS genex
in [INTERFACE_]LINK_LIBRARIES, 2021-05-26, v3.21.0-rc1~126^2) the
TARGET_OBJECTS genex, when referenced for linking, is now evaluated with
EvaluateForBuildsystem enabled.  This causes the object file paths to be
computed with a buildsystem-specific placeholder for the configuration.

This is normally fine because the placeholder will be evaluated by the
native buildsystem tool using the proper configuration.  However, the
Ninja Multi-Config generator's `${CONFIGURATION}` placeholder may not
have the correct value for cross-config object files.  Switch back to
using the per-config location of each object file for this generator.

Fixes: #22436
2021-07-21 11:46:15 -04:00
Brad King
078ba4b2a4 Swift: Update test case to try CMP0126 NEW behavior
Extend the `SwiftOnly` test to cover the fix in commit 3ddd7f3576
(enable_language: Fix test for working compiler with CMP0126 NEW
behavior, 2021-07-15), as that commit did for the `CSharpOnly` test.

Fixes: #22451
2021-07-21 11:37:45 -04:00
Brad King
e98bfa484f Merge topic 'message-color' into release-3.21
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6369
2021-07-21 11:34:04 -04:00
Brad King
6e04e06e67 Merge topic 'CMakeDependentOption-revert-parens' into release-3.21
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6368
2021-07-21 11:32:48 -04:00
Brad King
797aa4c410 Merge topic 'toolchain-CMP0126' into release-3.21
144be54dd3 try_compile: Propagate CMP0126 to the generated test project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6366
2021-07-21 11:31:29 -04:00
Brad King
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator 2021-07-20 14:52:01 -04:00
Brad King
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows
Since commit 0a0a0f8a74 (cmMessenger: Color messages to terminal by
type, 2021-05-18, v3.21.0-rc1~146^2) the message output no longer goes
through our custom streambuf on Windows that converts output encoding.
This can cause messages to be printed with the wrong encoding in a
Windows Console.  It also causes messages to have a mix of LF and CRLF
newlines because `stderr` converts LF to CRLF but our custom streambuf
does not.

Revert to using just `cerr` for messages on Windows.  Another approach
will be needed to achieve color output on Windows later.

Fixes: #22444
2021-07-20 13:30:11 -04:00
Brad King
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"
Revert commit 0665d9092e (CMakeDependentOption: Allow parentheses in the
depends string, 2021-06-13, v3.21.0-rc1~32^2).  It broke existing use
cases with parentheses in regular expressions.  Also add a test for this.

Fixes: #22447
2021-07-20 12:18:53 -04:00
Brad King
31ecd37180 Merge topic 'iar-exe-suffix' into release-3.21
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6357
2021-07-20 11:56:01 -04:00
Brad King
e10c776e58 Merge topic 'iar-host-exe' into release-3.21
1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6362
2021-07-20 11:55:05 -04:00
Lorenzo Cappelletti
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
Documentation for `CMAKE_EXECUTABLE_SUFFIX_<LANG>`, useful when
cross-compiling, is buried in section `CMAKE_EXECUTABLE_SUFFIX`.
2021-07-20 11:51:19 -04:00
Lorenzo Cappelletti
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX
Use `CMAKE_EXECUTABLE_SUFFIX_<LANG>` instead.

Fixes: #22426
2021-07-20 11:51:19 -04:00
Lorenzo Cappelletti
1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe
IAR is available for both Linux and Windows OSes.  Moreover,
binaries `*.exe` could be called from a Linux box, or vice versa.
See also commit 01a4eec446 (IAR: Changes required for Linux,
2019-04-25, v3.15.0-rc1~185^2).

Fixes: #22312
2021-07-20 11:50:09 -04:00
Brad King
91a904495a Merge topic 'enable_language-CMP0126' into release-3.21
f75610d492 CMakeDetermineCompilerId: Fix CMAKE_EXECUTABLE_FORMAT in CMP0126 NEW behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6364
2021-07-20 11:47:07 -04:00
Brad King
9a2f3d4b68 Merge topic 'autogen-ui-header-depends' into release-3.21
9cebdbec77 AUTOUIC: Fix cyclic dependency between generated UI headers and timestamp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6359
2021-07-20 11:46:00 -04:00
Brad King
97db2e6a30 Merge topic 'doc-policies-3.21' into release-3.21
7b5fa0f7b4 Help: Make policy CMP0126 wording more accurate
c4bc250f8c Help: Explain policy CMP0125 in more detail
6d5f74fcd7 Help: Clarify wording of CMP0124

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6360
2021-07-20 11:44:45 -04:00
Brad King
144be54dd3 try_compile: Propagate CMP0126 to the generated test project
Set policy CMP0126 to the value used in the calling project.
It may affect toolchain file behavior.
2021-07-20 09:47:02 -04:00
Craig Scott
3f3179aad1 Merge topic 'doc-cleanups-3.21' into release-3.21
8d1944c675 Help: Expand details for file(COPY_FILE)
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for
8be7694d97 Help: Fix trivial typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6361
2021-07-20 07:54:58 -04:00
Craig Scott
8d1944c675 Help: Expand details for file(COPY_FILE) 2021-07-20 08:49:04 +10:00
Craig Scott
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
The file(COPY_FILE) sub-command is closely related to the
file(COPY) sub-command. Move the former to just before the
latter for improved continuity. The file(RENAME) sub-command is
also somewhat related to file(COPY_FILE), so it was also moved to
keep it just before file(COPY_FILE).

The file(MAKE_DIRECTORY) sub-command was also moved to just
before the file(REMOVE) and file(REMOVE_RECURSE) sub-commands
to keep them together and improve logical flow of operations.
2021-07-20 08:39:34 +10:00
Brad King
f75610d492 CMakeDetermineCompilerId: Fix CMAKE_EXECUTABLE_FORMAT in CMP0126 NEW behavior
Setting `CMAKE_EXECUTABLE_FORMAT` as a normal variable is unnecessary
because setting it as a cache entry already makes the value visible to
the calling scope.

Fixes: #22433
2021-07-19 15:28:14 -04:00
Alexey Edelev
9cebdbec77 AUTOUIC: Fix cyclic dependency between generated UI headers and timestamp
Once the generated UI headers are created by UIC they also are involved
into processing in next run on ninja.  Autogen adds `ui_*.h` files to
the deps file `ui_*.h` and this cause timestamp start depend on `ui_*.h`.
Meanwhile `ui_*.h` depend on timestamp because of the explicit rules
added by commit 1265c65b33 (AUTOUIC: Collect ui header files for Ninja
generator, 2021-02-18, v3.21.0-rc1~600^2).  Avoid adding `ui_*.h` to
deps file at second ninja run.

Fixes: #16776
2021-07-19 13:28:16 -04:00
Brad King
4ff651eb52 Merge topic 'cmake-presets-no-binary-dir-no-s' into release-3.21
aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6358
2021-07-19 12:59:01 -04:00
Brad King
095f49ec36 Merge topic 'enable_language-CMP0126' into release-3.21
3ddd7f3576 enable_language: Fix test for working compiler with CMP0126 NEW behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6355
2021-07-19 12:50:57 -04:00
Brad King
38ad30c063 Merge topic 'libuv-mingw-arm' into release-3.21
1aba3a8367 libuv: Fix building with mingw toolchains for ARM/AArch64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6354
2021-07-19 12:48:40 -04:00
Brad King
9484e43731 Merge topic 'TestDriver-time.h-lint' into release-3.21
0bb3d457cb TestDriver: use `CM_NULL` to avoid lints about `nullptr` usage
32ff836e2a TestDriver: suppress deprecated header lints for time.h

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6352
2021-07-19 12:47:21 -04:00
Brad King
6004b997b0 Merge topic 'Help-ctest_memcheck-shared-args' into release-3.21
85e740312f Help/ctest_test: add a comment to also update `ctest_memcheck`
731cfd45fd Help/ctest_memcheck: mention `ctest_test` arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6351
2021-07-19 12:46:13 -04:00
Ben Boeckel
85e740312f Help/ctest_test: add a comment to also update ctest_memcheck
Since these commands share a common argument parser, the documentation
should be kept synchronized.
2021-07-19 12:45:17 -04:00
Brad King
292f336c50 Merge topic 'vs2022' into release-3.21
0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
1ac1436b25 VS: Fix `/sourceDependencies` flag table entries for v143
919fc7fd5f VS: Remove broken EnableASAN entry from flag table for v143
3f19847b28 VS: Remove empty ExternalWarningLevel entry from flag table for v143
ccb6083cbe VS: Remove empty LanguageStandard entries from flag table for v143
c167de7e70 VS: Remove empty ConformanceMode entry from flag table for v143
993d706a17 VS: Populate `/JMC-` flag table entry for v143
a070d87e08 VS: Populate `-Qspectre-` flag table entry for v143
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Egor Pugin <egor.pugin@gmail.com>
Merge-request: !6350
2021-07-19 12:41:19 -04:00
Craig Scott
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for 2021-07-18 16:45:20 +10:00
Craig Scott
8be7694d97 Help: Fix trivial typo 2021-07-18 15:57:06 +10:00
Craig Scott
7b5fa0f7b4 Help: Make policy CMP0126 wording more accurate
The OLD behavior only removes a non-cache variable of the same
name in specific circumstances. The previous wording implied
that it would always occur.

Also add a note about the behavior compared to the analogous
CMP0077 policy, which affects the option() command in a similar
but subtly different way.
2021-07-17 17:18:22 +10:00
Craig Scott
c4bc250f8c Help: Explain policy CMP0125 in more detail 2021-07-17 16:43:25 +10:00
Craig Scott
6d5f74fcd7 Help: Clarify wording of CMP0124 2021-07-17 16:43:25 +10:00
Kyle Edwards
aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir
When resolving binaryDir into a full path from a relative path, we
forgot to check if binaryDir is altogether empty, causing empty
binaryDir's to resolve to the source directory. Fix this.

Fixes: #22434
2021-07-16 10:25:40 -04:00