Commit Graph

8805 Commits

Author SHA1 Message Date
Brad King
350065bb85 Merge topic 'refactor-conditions-evaluation'
54a70b3988 Refactor: Move version compare op table out of the function
f37d6a3170 Refactor: Remove redundant checks for `0` and `1` literals
00961a4782 Refactor: Copy exactly required count of args and avoid `pop_back()`
2a72cad9be Style: Better names of local vars for `IN_LIST` handler
0dd7795706 Refactor: Extract the logic of testing for special variable to func
866b0595f6 Refactor: Introduce `cmArgumentList` container class
51d9194a96 Refactor: Reduce one more condition checking on handling math compare
46810235e3 Refactor: Avoid `if` → `else if` → … for compare operators
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6392
2021-08-06 12:12:02 -04:00
Brad King
8e798c4ed8 Merge topic 'ninja-lwyu-ar'
87589fd96a Merge branch 'backport-ninja-lwyu-ar' into ninja-lwyu-ar
93eb4a7bd1 Ninja: Revert accidental LINK_WHAT_YOU_USE impl for static libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6418
2021-08-06 10:55:48 -04:00
Brad King
87589fd96a Merge branch 'backport-ninja-lwyu-ar' into ninja-lwyu-ar 2021-08-03 11:58:59 -04:00
Đoàn Trần Công Danh
93eb4a7bd1 Ninja: Revert accidental LINK_WHAT_YOU_USE impl for static libraries
In commit d7159f9591, (Ninja: Fix LINK_WHAT_YOU_USE link flag placement,
2021-06-24), we fixed usage of -Wl,--no-as-needed to override
-Wl,--as-needed from LDFLAGS. However, that change also passes
-Wl,--no-as-needed to `ar`, which is incorrect flag for `ar`.

Let's check the target type before passing down the flags.

Fixes: #22487
2021-08-03 11:21:26 -04:00
Brad King
affd8b09e6 Merge topic 'vs10-deprecate'
22dab6eb96 Deprecate Visual Studio 10 2010 generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6412
2021-08-03 11:10:43 -04:00
Brad King
70daea512d Merge topic 'string-TIMESTAMP-specifier-V'
aafa392c12 string(TIMESTAMP): Add %V specifier for ISO 8601 week number
a915f691ad Help: Format string(TIMESTAMP) format specifiers as a definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6374
2021-08-03 11:08:34 -04:00
Brad King
a3ddcdb911 Merge topic 'nsis_ignore_license_page'
795e406e3b CPack/NSIS: Add option to not display license page

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6422
2021-08-03 11:06:45 -04:00
Brad King
e251bf5f68 Merge topic 'CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER'
9e7a0568f6 Merge branch 'backport-3.21-CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER
213fec4908 add_custom_command(DEPFILE) independent from CMAKE_DEPENDS_USE_COMPILER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6421
2021-08-03 10:59:38 -04:00
Alex Turbov
866b0595f6 Refactor: Introduce cmArgumentList container class
The `cmArgumentList` has been turned into a class (forward declared in
the header). It inherits from the `std::list` (yeah, but we don't intend
to store polymorphic classes in it). In addition to the standard methods,
now it's possible to move `HandlePredicate` (renamed to `ReduceOneArg`)
and `HandleBinaryOp` (renamed to `ReduceTwoArgs`) as its members.

Additionally, iterators managements (`IncrementArguments`) have been
refactored into two separate classes mimicking iterators. This also
allows having a uniform `for` loop and concentrates the logic of
iterators advancing in it instead of the loop's body. The arguments
processing algorithms operate with "windows" over a collection of
arguments. Hence there are two kinds of "iteration windows" -- allowing
to observe 2 or 3 elements per loop iteration. These iteration "windows"
also passed to reducers.
2021-08-03 10:55:47 -04:00
Brad King
99d3e20999 Merge topic 'vs-iface-include-dirs'
53aabe9817 VS: Fix assertion failure on INCLUDE_DIRECTORIES in INTERFACE libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6411
2021-08-02 14:07:13 -04:00
Brad King
bae8437895 Merge topic 'autogen-ui-header-depends'
283e8d8d04 AUTOUIC: Add test for cyclic dependency between UI headers and timestamp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: alcroito <alexandru.croitor@qt.io>
Merge-request: !6404
2021-08-02 14:04:08 -04:00
Antons Jeļkins
aafa392c12 string(TIMESTAMP): Add %V specifier for ISO 8601 week number
In ISO 8601 weeks begin with Monday. The first week of
the year is the week which contains the first Thursday
of the year.
2021-08-02 16:31:53 +02:00
Johnny Jazeix
795e406e3b CPack/NSIS: Add option to not display license page
Fixes: #22215
2021-08-01 18:28:47 +02:00
Marc Chevrier
9e7a0568f6 Merge branch 'backport-3.21-CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER 2021-08-01 15:26:21 +02:00
Marc Chevrier
213fec4908 add_custom_command(DEPFILE) independent from CMAKE_DEPENDS_USE_COMPILER
Fixes: #22486
2021-08-01 15:24:16 +02:00
Brad King
22dab6eb96 Deprecate Visual Studio 10 2010 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2021-07-29 14:15:01 -04:00
Brad King
53aabe9817 VS: Fix assertion failure on INCLUDE_DIRECTORIES in INTERFACE libraries
Since commit 4391913133 (Add INTERFACE libraries to generated
buildsystem if they have SOURCES, 2020-07-20, v3.19.0-rc1~346^2~1), the
VS generator may process INTERFACE libraries.  Avoid code paths in the
generator that process include directories because they should not be
used by INTERFACE libraries since they do not compile anything.

Fixes: #22494
2021-07-29 11:38:58 -04:00
Brad King
0a959bb271 Merge topic 'cuda_separable_clang_make' into release-3.21
3975678fcc CUDA/Clang: Simplify --register-link-binaries logic
0b1cea66cd CUDA/Clang: Fix separable compilation in non-root directories with Makefiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6400
2021-07-29 08:45:40 -04:00
Brad King
6064c70469 Merge topic 'cuda_separable_clang_make'
3975678fcc CUDA/Clang: Simplify --register-link-binaries logic
0b1cea66cd CUDA/Clang: Fix separable compilation in non-root directories with Makefiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6400
2021-07-29 08:45:40 -04:00
Brad King
5f1afff9f7 Merge topic 'ctest-test-changing-labels' into release-3.21
26170ea306 CTest: Reset multi-options to persistent multi-options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6403
2021-07-29 08:44:27 -04:00
root
0b1cea66cd CUDA/Clang: Fix separable compilation in non-root directories with Makefiles
Seems the relative paths were wrong basically all around such that only
compiling files in the top-level directory would work. I've modified
CudaOnly.SeparateCompilation to cover this.

Fixes #22482.
2021-07-29 13:19:37 +03:00
Alexey Edelev
283e8d8d04 AUTOUIC: Add test for cyclic dependency between UI headers and timestamp
Follow up test for the commit 9cebdbec.
2021-07-28 18:43:18 +02:00
Kyle Edwards
d2515f77e1 Merge branch 'master' into ctest-test-changing-labels 2021-07-28 09:59:23 -04:00
Kyle Edwards
26170ea306 CTest: Reset multi-options to persistent multi-options
44ad3f0b added multi-options to CTest, but didn't reset them,
causing ctest_test() to fail if it was run multiple times with
different label arguments. Reset the multi-options.

Fixes: #22485
2021-07-28 09:58:28 -04:00
Brad King
309a9cec9e Merge topic 'cmake-presets-v2-inherit-v3-optional'
3e42bf3e05 CMakePresets: Check presets with their own file version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6398
2021-07-28 09:14:40 -04:00
Kyle Edwards
3e42bf3e05 CMakePresets: Check presets with their own file version
06e6981 added support for optional binaryDir and generator, but
use the dependent preset's file version instead of the current
preset's file version. Check presets with their own file version
instead of their dependent's file version.

Fixes: #22428
2021-07-27 11:45:57 -04:00
Brad King
418313a7d6 Merge topic 'FindXCTest-xcode-12.5'
0b5301a778 FindXCTest: Fix output directory for test bundle with Xcode 12.5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6379
2021-07-27 09:11:33 -04:00
Brad King
675c130091 Merge topic 'FindXCTest-xcode-12.5' into release-3.21
0b5301a778 FindXCTest: Fix output directory for test bundle with Xcode 12.5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6379
2021-07-27 09:11:32 -04:00
Brad King
e423f530ba Merge topic 'test-compile-options-none'
91968ca668 Tests/CompileOptions: allow CMAKE_BUILD_TYPE=None

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6385
2021-07-27 09:08:35 -04:00
Yauheni Khnykin
0b5301a778 FindXCTest: Fix output directory for test bundle with Xcode 12.5
The fix from commit eafe740ead (FindXCTest: Fix output directory for
test bundle with new build system, 2021-02-09, v3.19.5~5^2) is not
necessary with Xcode 12.5, which seems to have changed/fixed the
behaviour again.

Fixes: #22462
2021-07-26 13:31:10 -04:00
Đoàn Trần Công Danh
91968ca668 Tests/CompileOptions: allow CMAKE_BUILD_TYPE=None
In the same spirit of commit ce1cadd35a, (Tests/ConfigSources: fix for
non main stream CMAKE_BUILD_TYPE, 2021-04-01).

Allow distributions' check to pass seemlessly.

Issue: #22470
2021-07-26 09:50:26 -04:00
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
f68bff274b Merge topic 'ninja-multi-test-fix'
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
00cbc4cff7 Merge topic 'autouic-header-depends'
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:52 -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
Kyle Edwards
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd 2021-07-23 13:22:59 -04:00
Brad King
ca2c63f423 Merge topic 'nmc-target-objects'
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:26 -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
cbe217682d Merge topic 'enable_language-CMP0126'
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:05 -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
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
b8021454ce Merge topic 'message-color'
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6369
2021-07-21 11:34:05 -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
abf8e92b44 Merge topic 'CMakeDependentOption-revert-parens'
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
992467c30c Merge topic 'toolchain-CMP0126'
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
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
c9d440fcaa Merge topic 'find_library_usable_from_script_mode'
aa3ab3eb92 find_library: Infer library prefix and suffix when in script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6338
2021-07-20 11:48:17 -04:00