Commit Graph

31903 Commits

Author SHA1 Message Date
Brad King 6e32db4fb3 Merge topic 'dotnet_sdk' into release-3.23
5cdd774d51 VS: Handle build target correct for .NET SDK style projects with Any CPU
309191052c VS: Set Visual Studio versions read out from solution file
f7791698cb VS: Allow setting output directory in .NET SDK style projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6944
2022-02-08 08:39:34 -05:00
Florian Schweiger 5cdd774d51 VS: Handle build target correct for .NET SDK style projects with Any CPU
* Extend Visual Studio solution parser for reading build target
* Map solution build target to project build target (especially for Any CPU)
* Use C++ <optional> template instead of pointer return value for cmSlnData::GetProjectByGUID
2022-02-07 13:08:37 +01:00
Florian Schweiger 309191052c VS: Set Visual Studio versions read out from solution file 2022-02-07 13:07:40 +01:00
Florian Schweiger f7791698cb VS: Allow setting output directory in .NET SDK style projects 2022-02-07 12:03:03 +01:00
Brad King ce00bfd75e Merge topic 'vs-simplify-pch' into release-3.23
dd1e2cc80c VS: Simplify generation of per-source PCH settings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6950
2022-02-04 08:19:18 -05:00
Brad King d184bf0659 Replace DEVEL_CMAKE_VERSION with literal 3.23 release version
This was accidentally left out of commit 736663deed (Begin 3.23 release
versioning, 2022-02-03).  The step is documented as part of the release
branching process in the CMake Maintainer Guide `Help/dev/maint.rst`.
2022-02-04 06:44:22 -05:00
Brad King dd1e2cc80c VS: Simplify generation of per-source PCH settings
Avoid looking up the PCH create/use flags just to map them through
flag tables back to the `.vcxproj` settings.  Instead, simply
generate the PCH settings directly for each source file.

Since commit 9df1f33c9a (VisualStudio: move PCH rules to projects when
possible., 2020-10-15, v3.20.0-rc1~638^2) we already do this for the
target-wide PCH settings.
2022-02-03 15:52:22 -05:00
Brad King 736663deed Begin 3.23 release versioning 2022-02-03 09:12:55 -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 0c0d4e1c7a Merge topic 'cmake-presets-configure-preset-reachability'
c18409cdac CMakePresets.json: Ensure configurePreset is reachable from current file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6937
2022-02-03 07:32:54 -05:00
Kitware Robot fb26581653 CMake Nightly Date Stamp 2022-02-03 00:01:15 -05:00
Kyle Edwards c18409cdac CMakePresets.json: Ensure configurePreset is reachable from current file 2022-02-02 15:17:30 -05:00
Kyle Edwards 201d8c4298 find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable
Fixes: #20878
2022-02-02 11:09:00 -05:00
Kyle Edwards bd805a51ae Refactor: Keep track of prefixes in cmSearchPath 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
Kitware Robot ece32491ab CMake Nightly Date Stamp 2022-02-02 00:01:17 -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
Brad King 012ea11ea4 Merge topic 'update-kwsys'
1e242a95d0 Merge branch 'upstream-KWSys' into update-kwsys
7d9204a7e2 KWSys 2022-01-31 (9fd1660a)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6930
2022-02-01 10:38:07 -05: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
Kitware Robot 0294570d06 CMake Nightly Date Stamp 2022-02-01 00:01:17 -05:00
Brad King 1e242a95d0 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2022-01-31 (9fd1660a)
2022-01-31 15:27:01 -05:00
Kyle Edwards 11f97d1968 find_package(): Refactor CMAKE_[SYSTEM_]IGNORE_PATH
In the old implementation, CMAKE_[SYSTEM_]IGNORE_PATH was handled
in cmFindCommon. Move it into cmFindPackageCommand.
2022-01-31 10:41:04 -05: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
Brad King d3006c0ca7 Merge topic 'shorter-obj'
5f8c5657a9 Shorten object name even if still longer than CMAKE_OBJECT_PATH_MAX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6915
2022-01-31 10:30:30 -05:00
Brad King 3de6155ca0 Merge topic 'update-kwsys'
e83bb75160 Merge branch 'upstream-KWSys' into update-kwsys
d01d634bc7 KWSys 2022-01-29 (389a74dc)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6919
2022-01-31 10:29:38 -05:00
Kitware Robot cacfadd84a CMake Nightly Date Stamp 2022-01-31 00:01:31 -05:00
Kitware Robot 4b033ca0eb CMake Nightly Date Stamp 2022-01-30 00:01:13 -05:00
Brad King e83bb75160 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2022-01-29 (389a74dc)
2022-01-29 07:06:10 -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 193a999cd5 cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage
These properties will be given meaning by later commits.
2022-01-29 06:48:12 -05:00
Brad King 22d5427aa6 cmGeneratorTarget: Add LookupLinkItem option to consider own target name 2022-01-29 06:48:12 -05:00
Brad King f3d2eab36a cmGeneratorTarget: Fix link interface caching of partial results
`GetLinkInterface` and `GetLinkInterfaceLibraries` cache their results
to avoid repeating work.  In the case that the result does not depend on
the "head" target, they re-use results computed from the first call with
any "head" target.  However, if `GetLinkInterfaceLibraries` is called
first, then not all of the link interface is populated.  If
`GetLinkInterface` is later called, it needs to finish populating the
link interface even if a partially completed interface was cached.
2022-01-29 06:48:12 -05:00
Brad King d75ab9d066 cmGeneratorTarget: Clarify CMP0022 logic in ComputeLinkInterfaceLibraries
Follow up commit 1d709ea2f5 (cmGeneratorTarget: Propagate backtraces
from INTERFACE_LINK_LIBRARIES, 2021-12-15), which made the logic a bit
more complicated due to having backtraces for CMP0022 NEW behavior.
2022-01-29 06:48:12 -05:00
Brad King f3e9e03fe0 cmGeneratorTarget: Simplify CMP0022 warning check
Since commit 1d709ea2f5 (cmGeneratorTarget: Propagate backtraces from
INTERFACE_LINK_LIBRARIES, 2021-12-15) we can use the special storage of
the property directly.
2022-01-29 06:48:12 -05:00
Brad King 216aa14997 cmGeneratorTarget: Return early from ExpandLinkItems with no items 2022-01-29 06:48:12 -05:00
Brad King 4e8f24e977 PCH: Clear link interface cache when adding PCH object to it
On platforms using `CMAKE_LINK_PCH`, the implementation of
`PRECOMPILE_HEADERS_REUSE_FROM`, when re-using the PCH from one object
library in another, adds a PCH object file to the link interface.
Clear any cached link interface to ensure it is used.
2022-01-29 06:48:11 -05:00
Brad King 854e67985e cmLinkItem: Clarify name of CMP0027 check member
The only purpose of `cmLinkImplItem`'s `FromGenex` member is to decide
whether to check CMP0027.  That won't be needed for link items added by
new interfaces in the future.  Clarify the name to indicate that we do
not always need to know if the item came from a generator expression.
2022-01-29 06:48:11 -05:00
Brad King f6170c1322 cmGeneratorExpressionDAGChecker: Re-order EvaluatingLinkLibraries condition
Place the modern properties first.
2022-01-29 06:46:35 -05:00
Brad King 16fbf6ccb6 Merge topic 'gcc12-warning'
ae101921e8 Source: Avoid gcc 12 compilation warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6916
2022-01-29 06:30:19 -05:00
Kitware Robot 4b2ab96c51 CMake Nightly Date Stamp 2022-01-29 00:01:17 -05:00
Nick Little 5f8c5657a9 Shorten object name even if still longer than CMAKE_OBJECT_PATH_MAX
In some cases the shortened path may end up working in practice, even if
it is over CMAKE_OBJECT_PATH_MAX, where the original path does not.
If the original path is too long, do the MD5 substitution whenever it
makes the path shorter.  Retain the warning if it is still too long.
2022-01-28 11:12:59 -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
Brad King 4ff6ea0f2f Merge topic 'timestamp-microseconds'
c050d6a01e string(TIMESTAMP): add %f specifier for microseconds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6910
2022-01-28 09:39:03 -05:00
Brad King 5126b3b8d1 Merge topic 'message-flush'
634587e322 message: Restore explicit flushing of messages on stderr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6913
2022-01-28 09:36:02 -05:00
Brad King ae101921e8 Source: Avoid gcc 12 compilation warning
GCC 12 warns:

    warning: '%04d' directive output may be truncated writing between
    4 and 11 bytes into a region of size 5 [-Wformat-truncation=]

The surrounding logic guarantees the formatted integer will never
be more than 4 bytes, but it doesn't hurt to use a larger buffer.
This GCC behavior is documented:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104012#c5
2022-01-28 08:06:13 -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
Kitware Robot ee1bed5058 CMake Nightly Date Stamp 2022-01-28 00:01:22 -05:00