Commit Graph

3715 Commits

Author SHA1 Message Date
Brad King
a21d5455c0 Merge topic 'autogen-dep-on-imported-implib-only-target'
895fa3433f cmQtAutoGenInitializer: support IMPLIB-only imported targets
354c1f5628 Tests/RunCMake/Autogen: test CMP0111 behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6558
2021-09-27 13:48:57 -04:00
Ben Boeckel
354c1f5628 Tests/RunCMake/Autogen: test CMP0111 behavior
On Windows, imported shared libraries which only have an
`IMPORTED_IMPLIB` set fail if they are depended upon by a target using
automoc. Add a test for the behavior of depending upon all imported
target types from an automoc-using target.
2021-09-24 11:29:54 -04:00
Brad King
b0b689d566 Merge topic 'cat_empty_file'
0b4a56e64b cmake: -E cat stops when an empty file is encountered

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6539
2021-09-21 11:05:06 -04:00
Pino Toscano
b07812c6de Tests: fix RunCMake.CPack_DEB.EXTRA on Debian non-Linux OSes
The generated path with the packages uses $CPACK_TOPLEVEL_TAG, which
by default is $CPACK_SYSTEM_NAME, thus the OS name.

To make the expected stderr match also non-Linux OSes, accept any
non-slash characters in place of "Linux", so it works also on other
Debian OSes (e.g. Debian/Hurd).
2021-09-18 21:49:46 +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
Craig Scott
0d2719d311 Merge topic 'xcode-embed-libraries'
6ef7bfbb64 Xcode: add support for embedding dynamic libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6490
2021-09-16 17:46:09 -04:00
Cristian Adam
3b9e04accb PCH: MSVC: Restrict OBJECT library INTERFACE_LINK_LIBRARIES usage
The pch object file could cause problems when the reused pch is passed
through an OBJECT library, which would use INTERFACE_LINK_LIBRARIES to
link the pch object file.

Fixes: #22630
2021-09-15 10:39:46 -04:00
Brad King
69c0a5daf9 Merge topic 'pch-xcode-multiple-languages'
bbcdac4e5d PCH: Fix all-language precompile header support in Xcode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6435
2021-09-14 09:48:00 -04:00
Brad King
2a8d9bf4cc Merge topic 'CMakeDependentOption-condition-syntax'
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6493
2021-09-14 09:35:07 -04:00
Lucas SOLTIC
6ef7bfbb64 Xcode: add support for embedding dynamic libraries 2021-09-14 08:39:22 +10:00
Cristian Adam
bbcdac4e5d PCH: Fix all-language precompile header support in Xcode
Fixes: #22384
2021-09-13 08:12:11 -07:00
Daniel Schürmann
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax
Fixes: #22303
2021-09-10 09:46:55 -04:00
Brad King
293070c325 Merge topic 'vs_settings'
f21158cdfe VS: Honor VS_SETTINGS source file property on all sources
3bf013632d cmVisualStudio10TargetGenerator: Factor out helper to write VS_SETTINGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6492
2021-09-10 09:34:17 -04:00
Steven Boswell
f21158cdfe VS: Honor VS_SETTINGS source file property on all sources
Extend the feature added by commit 2ce42f281f (VS: Add VS_SETTINGS
source file property, 2020-03-18, v3.18.0-rc1~449^2~3) to support
all source file types.
2021-09-09 14:19:28 -04:00
Ben Boeckel
ce44c2cec3 ctest_memcheck: generate DynamicAnalysis-Test.xml as well
This is useful so that memcheck results also show up as test results on
CDash. It will be submitted with the other `MemCheck` parts.

Fixes: #22190
2021-09-08 21:04:46 -04:00
Brad King
cf90aa5595 Merge topic 'host-distro-info'
b9698f89df cmake_host_system_information: Make it available for all systems
5469c71a82 Refactor: Simplify `GetValue()` function calls
6c92f80f2e cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT`
efe139d1b8 cmake_host_system_information: Can run fallback scripts
1e65e4a6e5 cmake_host_system_information: Can read `/etc/os-release` file
e808cbb1dd Testing: Convert `cmake_host_system_information` tests into `RunCMake`
9e831284e5 Documentation: Use definition list instead of tables
346f3de005 Refactor: Deduplicate code for `VS_nn_DIR` keys processing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6410
2021-08-24 10:04:15 -04:00
Alex Turbov
b9698f89df cmake_host_system_information: Make it available for all systems
Before it was Linux only.
2021-08-20 09:35:12 -04:00
Alex Turbov
6c92f80f2e cmake_host_system_information: Also set USED_FALLBACK_SCRIPT
If the OS identification was obtained via fallback script.
2021-08-20 09:35:12 -04:00
Alex Turbov
efe139d1b8 cmake_host_system_information: Can run fallback scripts 2021-08-20 09:35:12 -04:00
Alex Turbov
1e65e4a6e5 cmake_host_system_information: Can read /etc/os-release file 2021-08-20 09:35:09 -04:00
Brad King
135e79038c Merge topic 'FindPkgConfig-restore-legacy-behavior'
17e4934dbf FindPkgConfig: Restore legacy behavior when CMP0126 is set to NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6461
2021-08-19 10:27:24 -04:00
Marc Chevrier
17e4934dbf FindPkgConfig: Restore legacy behavior when CMP0126 is set to NEW
Module behavior must be independent from `CMP0126` policy.

Fixes: #22526
2021-08-18 14:51:50 -04:00
Brad King
1f3dceea57 Merge topic 'while-regression'
eae125ace5 Refactor: Get rid of `isTrue` variable in the `while` block execution
4c1cdfd8f0 Refactor: Keep `cmWhileFunctionBlocker` members private
d22f68d019 Refactor: Transform `while` loop into `for`
e97e714f0d Fix: `while()` reports an error the same way as `if()`
880ca66b51 Fix: `while()` can silently ignore incorrect condition
61b33c3f4e Fix: Regression in the `cmConditionEvaluator::HandleLevel0`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6442
2021-08-18 10:49:16 -04:00
Brad King
1b3d892ac2 Merge topic 'GoogleTest-gtest-filter'
ea6a7dd1c2 GoogleTest: Add TEST_FILTER arg to gtest_discover_tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6406
2021-08-10 09:26:49 -04:00
Alex Turbov
e97e714f0d Fix: while() reports an error the same way as if()
With arguments list expanded.
2021-08-09 22:35:11 +03:00
Alex Turbov
880ca66b51 Fix: while() can silently ignore incorrect condition
When `conditionEvaluator.IsTrue(...)` returns `false` it just
didn't print the error occured.
2021-08-09 22:35:11 +03:00
Alex Turbov
61b33c3f4e Fix: Regression in the cmConditionEvaluator::HandleLevel0
As reported in the BUG #22524, mismatched parenthesis reported differently
for `while()` and `if()`.

The problem was in the double loop (over "handlers" and the arguments),
where the outer loop didn't check the result of the running handler.
2021-08-09 21:05:09 +03:00
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
86633cc203 Merge topic 'ninja-lwyu-ar' into release-3.21
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
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
Ashish Sadanandan
ea6a7dd1c2 GoogleTest: Add TEST_FILTER arg to gtest_discover_tests
The `TEST_FILTER` argument can be used to filter tests during the
discovery phase. It combines `--gtest_filter=<expr>` with the
`--gtest_list_tests` argument when invoking the test excutable for
listing defined tests.

Fixes: #17493
2021-08-05 00:43:17 -06: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
54be23df7f Merge topic 'CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into release-3.21
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
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
Alex Turbov
e808cbb1dd Testing: Convert cmake_host_system_information tests into RunCMake 2021-08-02 23:43:47 +03: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
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
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
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
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