Commit Graph

9073 Commits

Author SHA1 Message Date
Brad King
3900a31f44 Merge topic 'test-mfc-explicit' into release-3.23
9d621ceba1 Tests: Run MFC test only when explicitly enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6943
2022-02-04 08:08:23 -05:00
Brad King
8d4e353ede Merge topic 'ci-minor-cleanups' into release-3.23
040c509bce gitlab-ci: clarify name of windows fragment for building with ninja
bd14f07ce9 Tests: Skip Clang PCH_INSTANTIATE_TEMPLATES test in MSVC ABI
c26b064b8c Tests: Suppress MSVC CRT deprecation warnings in pseudo_llvm-rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6947
2022-02-03 09:57:45 -05:00
Brad King
7077916781 Merge topic 'cmake-ignore-prefix-path'
201d8c4298 find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable
bd805a51ae Refactor: Keep track of prefixes in cmSearchPath

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6880
2022-02-03 07:35:23 -05:00
Brad King
9d621ceba1 Tests: Run MFC test only when explicitly enabled
Previously we used a complicated heuristic to decide whether or not to
run the MFC test, but it sometimes decided incorrectly to run the test.
Since that was first written, we have developed a convention for other
tests to enable them via undocumented cache entries that are added only
on machines known to meet the tests' requirements.  Do that for MFC.
2022-02-03 06:45:53 -05:00
Kyle Edwards
c18409cdac CMakePresets.json: Ensure configurePreset is reachable from current file 2022-02-02 15:17:30 -05:00
Brad King
bd14f07ce9 Tests: Skip Clang PCH_INSTANTIATE_TEMPLATES test in MSVC ABI 2022-02-02 15:02:51 -05:00
Brad King
c26b064b8c Tests: Suppress MSVC CRT deprecation warnings in pseudo_llvm-rc 2022-02-02 14:46:25 -05:00
Kyle Edwards
201d8c4298 find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable
Fixes: #20878
2022-02-02 11:09:00 -05:00
Brad King
9245925810 Merge topic 'cuda_generic_arch_all'
8f64df0a7c CUDA: Generic all and all-major support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6816
2022-02-02 08:23:19 -05:00
Brad King
0f316675cf Merge topic 'dotnet_ref_in_sdk'
5ee3154f65 VS: .Net SDK Style projects can add Reference to dlls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6932
2022-02-02 08:21:16 -05:00
Brad King
1e1e04db75 Merge topic 'ep-redownload-on-SOURCE_DIR-change'
d3477eba06 ExternalProject: Rerun download on SOURCE_DIR change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6926
2022-02-02 08:17:51 -05:00
Brad King
efe3af0119 Tests: Update FindBoost.TestPython for Python 3.10
Follow up commit d4bb6c0c7f (FindBoost: Add support for Python 3.10,
2021-12-16, v3.22.2~14^2) with an update for the FindBoost test.
2022-02-01 17:20:28 -05:00
Brad King
c138ddb943 Merge topic 'refactor-find-package-cmake-ignore-path'
11f97d1968 find_package(): Refactor CMAKE_[SYSTEM_]IGNORE_PATH
30e5c1d92b find_package(): Add tests for CMAKE_IGNORE_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6918
2022-02-01 12:04:33 -05:00
Raul Tambre
8f64df0a7c CUDA: Generic all and all-major support
Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags,
2021-08-17) added all and all-major options to CUDA_ARCHITECTURES. These are
fairly generic and likely to see real-world use by distributors. Thus it's
desirable to support these also for Clang and older NVCC versions.

The supported architectures are dependent on the toolkit version. We determine
the toolkit version prior to compiler detection. For NVCC we get the version
from the vendor identification output, but for Clang we need to invoke NVCC
separately.

The architecture information is mostly based on the Wikipedia list with the
earliest supported version being CUDA 7.0. This could be documented and
expanded in the future to allow projects to query CUDA toolkit version and
architecture information.
For Clang we additionally constrain based on its support.

Additionally the architecture mismatch detection logic is fixed, improved and
updated for generic support:
* Commit 01428c55 (CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work
  during detection, 2020-08-29) enabled CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS
  if CMAKE_CUDA_ARCHITECTURES is specified. This results in
  CMakeDetermineCompilerID.cmake printing the compiler error and our code for
  presenting the mismatch in a user-friendly way being useless. The custom
  logic seems preferable so go back to not enabling it.
* Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags,
  2021-08-17) tried to support CMP0054 but forgot to add x to the interpolated
  result. Thus the conditions would always evaluate to false. This is fixed as
  a byproduct of removing NVIDIA specific checks, improving the error message
  and replacing architectures_mode with a simpler architectures_explicit.

Visual Studio support omits testing the flags during detection due to
complexities in determining the toolkit version when using it.
A long-term proper implementation would be #23161.

Implements #22860.
2022-02-01 18:25:20 +02:00
Sumit Bhardwaj
5ee3154f65 VS: .Net SDK Style projects can add Reference to dlls
When support for `DOTNET_SDK` was added, only a minimal set of options
were built in. Based on user feedback, support for reference to dlls
(not just projects) is needed. That support is added here.

Fixes: #23166
2022-02-01 07:18:03 -08:00
Craig Scott
d3477eba06 ExternalProject: Rerun download on SOURCE_DIR change
Fixes: #21748
2022-02-01 22:31:29 +11:00
Brad King
5305d5aa1a Merge topic 'link-interface-direct'
f3ad061858 Add usage requirements to update direct link dependencies
193a999cd5 cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage
22d5427aa6 cmGeneratorTarget: Add LookupLinkItem option to consider own target name
f3d2eab36a cmGeneratorTarget: Fix link interface caching of partial results
d75ab9d066 cmGeneratorTarget: Clarify CMP0022 logic in ComputeLinkInterfaceLibraries
f3e9e03fe0 cmGeneratorTarget: Simplify CMP0022 warning check
216aa14997 cmGeneratorTarget: Return early from ExpandLinkItems with no items
1bc98371d1 Tests: Remove unnecessary policy setting from ObjectLibrary test
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6886
2022-01-31 10:36:55 -05:00
Kyle Edwards
30e5c1d92b find_package(): Add tests for CMAKE_IGNORE_PATH 2022-01-31 10:33:54 -05:00
Brad King
f3ad061858 Add usage requirements to update direct link dependencies
Link line construction starts with `LINK_LIBRARIES` and appends
dependencies from the transitive closure of `INTERFACE_LINK_LIBRARIES`.
Only the entries of `LINK_LIBRARIES` are considered direct link
dependencies.  In some advanced use cases, particularly involving static
libraries and static plugins, usage requirements need to update the list
of direct link dependencies.  This may mean adding new items, removing
existing items, or both.

Add target properties to encode these usage requirements:

* INTERFACE_LINK_LIBRARIES_DIRECT
* INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE

Fixes: #22496
2022-01-29 06:48:13 -05:00
Brad King
1bc98371d1 Tests: Remove unnecessary policy setting from ObjectLibrary test
Since commit 72e7c45e98 (Tests: Bump CMake minimum required in tests to
2.8.12, 2020-12-22, v3.20.0-rc1~224^2), policy CMP0022 is set to NEW for
the entire test.  Remove a leftover explicit setting.
2022-01-29 06:48:12 -05:00
Brad King
6108352f0a Merge topic 'ibmclang-compiler'
8c1731546c Help: Add release note for IBM Open XL C/C++ compiler support
24da80b70a Utilities: Suppress warnings in third-party code with IBMClang
6da99e671c IBMClang: Add support for IBM Open XL C/C++

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6785
2022-01-28 09:50:15 -05:00
Brad King
ba069c10dd Merge topic 'cuda_vs_arch_all'
daf372c4d6 CUDA: Fix issuing error if default architecture detection fails
7a0d098352 CUDA: Error on empty/invalid CMAKE_CUDA_ARCHITECTURES set by user
d19273bc7b CUDA: Support all and all-major on Visual Studio
5f667d783a CUDA: Actually use reverse architecture deprecation order for Clang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !6912
2022-01-28 09:40:50 -05:00
Peter Würth
c050d6a01e string(TIMESTAMP): add %f specifier for microseconds
The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP)
commands to output the timestamp with a microsecond resolution.
This convention is offered by python's datetime module.
Before, the precision was limited to seconds.

The implementation is done by extending existing cmTimestamp methods
with a `microseconds` parameter. This parameter is optional in order to
be backwards compatible. The timestamps are now received in a
cross-platform manner using libuv, since the standard C functions like
time() don't allow for sub-second precision.

This requires libuv 1.28 or higher.  We already require higher than
that on Windows, so update the required version for other platforms.

Implements: #19335
2022-01-28 06:23:57 -05:00
Raul Tambre
7a0d098352 CUDA: Error on empty/invalid CMAKE_CUDA_ARCHITECTURES set by user
If empty we otherwise treat it the same as unset in most places, but still end
up failing eventually with a confusing "Failed to find a working CUDA
architecture".

This also detects some other basic invalid ones (e.g. "al").
2022-01-27 22:11:13 +02:00
Aaron Liu
6da99e671c IBMClang: Add support for IBM Open XL C/C++
Fixes: #22929
2022-01-27 09:38:01 -05:00
Brad King
a87c72cba8 Merge topic 'ep_test_with_build_with_server-arg-fix'
9406b2073e Tests: Remove stray argument from test invocation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6893
2022-01-25 08:19:52 -05:00
Brad King
d5e3b1ca1e Merge topic 'cmp0128_cuda'
ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default
b2c25de8e0 CMP0128: Avoid test code duplication
3a089cd256 CMP0128: Prefix test names with mode
e13dd52535 XL: Detect default extensions mode for legacy compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6890
2022-01-24 12:37:52 -05:00
Brad King
63154cbf45 Merge topic 'vs-package-restore'
9aa7831f05 Presets: add resolve packages setting to build presets.
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages.
193b8fca52 cmBuildOptions: Split build arguments into separate object.
6a10103493 Help: Update preset schema description for version 3 entries.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6761
2022-01-24 11:46:29 -05:00
Craig Scott
9406b2073e Tests: Remove stray argument from test invocation
The run_cmake_with_options() command already sets the test
command to ${CMAKE_COMMAND}. The options passed to that
command shouldn't also add another ${CMAKE_COMMAND}.
This removes a warning seen in the output of tests that invoke
__ep_test_with_build_with_server().
2022-01-24 22:25:06 +11:00
Raul Tambre
ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default
Commit 4a0485be (cmStandardLevelResolver: Avoid unnecessary flags, fix unset
level logic, 2021-04-29) unintentionally changed the behavior by modifying the
code to match a pre-existing comment. The resulting behavior change however
matches the intentions of CMP0128, so we simply need to guard it.

Fixes #23122.
2022-01-23 23:10:28 +02:00
Raul Tambre
b2c25de8e0 CMP0128: Avoid test code duplication 2022-01-23 23:10:28 +02:00
Raul Tambre
3a089cd256 CMP0128: Prefix test names with mode
Makes clear that these tests are for the NEW behaviour.
2022-01-23 23:10:28 +02:00
Carsten Rudolph
9aa7831f05 Presets: add resolve packages setting to build presets. 2022-01-22 06:35:41 -05:00
Carsten Rudolph
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages. 2022-01-22 06:35:41 -05:00
Brad King
b23f57f307 Merge topic 'cmake-warn-extra-paths'
eacf1f879b cmake: Warn about unnecessary paths on command line
a4f076110d Tests: Fix RunCMake.CommandLine toolchain case command line

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6882
2022-01-21 09:17:27 -05:00
Brad King
a86e42a0f5 Merge topic 'target-properties-from-variables'
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6865
2022-01-21 09:16:46 -05:00
Robert Maynard
eacf1f879b cmake: Warn about unnecessary paths on command line
We can't make it an error as that would break existing behavior.

Fixes: #23110
2022-01-20 14:38:12 -05:00
Brad King
a4f076110d Tests: Fix RunCMake.CommandLine toolchain case command line 2022-01-20 14:36:48 -05:00
Brad King
a47b4387b4 Merge topic 'cmake-presets-include-outside-project-dir'
0c2d234bc9 CMakePresets: Allow files included from CMakePresets.json to be anywhere

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !6867
2022-01-20 11:55:35 -05:00
Kyle Edwards
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
2022-01-20 09:05:35 -05:00
Kyle Edwards
0c2d234bc9 CMakePresets: Allow files included from CMakePresets.json to be anywhere
There are some valid use cases for allowing these files to be outside
the project directory. Relax the restriction, and include a strong
warning in the documentation.
2022-01-19 11:21:35 -05:00
Brad King
1ca83ae2bb Merge topic 'cpack-dmg-sla'
9e38bfa915 CPack/DMG: Add explicit option to use CPACK_RESOURCE_FILE_LICENSE for SLA
542ba6ac1a Tests: Add CPack/DMG case covering SLA from CPACK_RESOURCE_FILE_LICENSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6876
2022-01-19 09:09:39 -05:00
Brad King
196243d668 Merge topic 'define-property-optional-args'
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
7d26baff46 cmDefinePropertyCommand: Refactor to use cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6875
2022-01-19 09:06:58 -05:00
Brad King
2042e0781a Merge topic 'handle_multiple_source_dirs'
b2bc3364f0 CMake: `-S` paths preferred over other provided paths
2e1b7e5b9a Add tests that showcase cmake -S limitations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6874
2022-01-19 09:05:21 -05:00
Brad King
6b44cd7d3a Merge topic 'depfile-parsing-update'
0b65a2b253 add_custom_command(DEPFILE): ensure all dependencies are taken into account
e04a352cca Depfile parsing: enhance compatibility with GNU Make

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6861
2022-01-19 09:02:57 -05:00
Kyle Edwards
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
Issue: #20698
2022-01-18 15:52:01 -05:00
Brad King
9e38bfa915 CPack/DMG: Add explicit option to use CPACK_RESOURCE_FILE_LICENSE for SLA
Since macOS 12.0, the ``hdiutil udifrez`` and ``hdiutil udifderez``
commands to embed and extract resources in a disk image are deprecated.
The CPack DragNDrop Generator uses these to attach the SLA specified by
the `CPACK_RESOURCE_FILE_LICENSE` option.  Since that option is shared
by multiple CPack generators, we cannot deprecate it.  Instead, add an
explicit option to control the behavior.  This will give projects a way
to package on future macOS versions that remove the commands.

In order to provide a long-term transition away from attaching SLAs to
disk images, update `cpack` to default this behavior to OFF.  To retain
compatibility for CMake projects, teach the CPack module to default the
option to ON.  Later a policy can be added to change the default.

Issue: #22978
2022-01-18 15:39:51 -05:00
Brad King
542ba6ac1a Tests: Add CPack/DMG case covering SLA from CPACK_RESOURCE_FILE_LICENSE 2022-01-18 15:37:38 -05:00
Brad King
0604c79c07 Merge topic 'CheckLinkerFlag-update-implementation'
9d1b9a4aa1 CheckLinkerFlag: rely now on internal implementation
660e0d80ae internal/CheckCompilerFlag: rely on common configuration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6860
2022-01-18 12:08:58 -05:00
Brad King
8ffa7b7957 Merge topic 'find_library-clean-env'
b916860a48 Tests: Avoid interference from environment in RunCMake.find_library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6868
2022-01-18 12:06:23 -05:00