Commit Graph

5756 Commits

Author SHA1 Message Date
Marc Chevrier
a2cfa2da4f GenEx/LINK_LIBRARY: Add features for framework support on Apple 2022-02-15 10:53:33 +01:00
Brad King
551b0af1e5 Merge topic 'trace-line-range'
8e1e97ccca Trace: include `line_end` field in json-v1 format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6968
2022-02-11 09:14:15 -05:00
Brad King
cd71d7f663 Merge topic 'doc-if-AND-OR'
41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6970
2022-02-10 09:11:13 -05:00
Brad King
e6618f3baf Merge topic 'doc-MSVC_TOOLSET_VERSION-v143'
dca3a032d1 Help: Add MSVC_TOOLSET_VERSION value for v143 toolset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6966
2022-02-10 08:48:22 -05:00
Brad King
41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions
The wording update in commit b74819e4fe (Help: Format 'if' command
documentation, 2013-12-18, v3.0.0-rc1~227^2~1) incorrectly implied that
`AND` has higher precedence than `OR`.  Although this is common in many
languages, it has never been true in CMake's implementation.  Revise
the wording to clarify the precedence.

Add a test case demonstrating the order.

Fixes: #23207
2022-02-09 14:24:43 -05:00
Braulio Valdivielso Martinez
8e1e97ccca Trace: include line_end field in json-v1 format
After !6954 got merged, it has become easier for tools to get
full stack-traces for runtime traces of a CMake program. The trace
information already included in the JSON objects (line number, source
file path) allows tools that display these stack traces to print the
CMake source code associated to them. However, CMake commands may
spawn multiple lines, and the JSON information associated to a trace
only contains the line in which the command started, but not the one
in which it ended. If tools want to print stack traces along the
relevant source code, and they want to print the whole command
associated to the stack frame, they will have to implement their own
CMake language parser to know where the command ends.

In order to simplify the life of those who want to write tooling for
CMake, this commit adds a `line_end` field to the json-v1 trace
format. If a given command spans multiple lines, the `line_end` field
will contain the line of the last line spanned by the command (that of
the closing parenthesis associated to the command).
2022-02-09 13:30:11 -05:00
Heiko Thiel
dca3a032d1 Help: Add MSVC_TOOLSET_VERSION value for v143 toolset
This was accidentally left out of commit f01ea7e391 (MSVC: Fix
MSVC_TOOLSET_VERSION for VS 2022 v143 toolset, 2019-04-03,
v3.21.3~10^2~1).
2022-02-09 09:53:11 -05:00
Brad King
e40cea3fe9 Merge topic 'genex-LINK_LIBRARY-to-decorate-library'
2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property
42965799b4 Genex: Add $<LINK_LIBRARY:...>
78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse
4b55828a9f cmExpandListWithBacktrace: add handling of empty elements.
28d7432468 cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6769
2022-02-09 09:28:20 -05:00
Brad King
3d5466d5e9 Merge topic 'trace-global-frame'
a41d6e4d7a Trace: add global_frame field to json-v1 format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6954
2022-02-09 09:04:43 -05:00
Brad King
25003baf50 Merge topic 'vs_buildcache_support'
b764c7c273 VS: Add property to turn off Visual Studio compile batching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6957
2022-02-09 08:59:45 -05:00
Marc Chevrier
2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property
To enable the management of incompatible $<LINK_LIBRARY> declarations,
add LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> target
properties.
2022-02-08 11:41:04 +01:00
Kaloyan Donev
b764c7c273 VS: Add property to turn off Visual Studio compile batching
Resolves: #23179
2022-02-08 08:07:00 +02:00
Marc Chevrier
42965799b4 Genex: Add $<LINK_LIBRARY:...>
This generator expression offers the capability, for the link step, to
decorate libraries with prefix/suffix flags and/or adding any specific flag for each
library.

Fixes: #22812, #18751, #20078, #22703
2022-02-08 00:02:32 +01:00
Braulio Valdivielso Martinez
a41d6e4d7a Trace: add global_frame field to json-v1 format
Tools using the json-v1 format might want to trace stack frames across
different `CMakeLists.txt` files, in order to, for example, provide
stacktraces that span from the top-level `CMakeLists.txt` in a
project. One would think that `frame` lets you do that, but it
doesn't, because it tells you the depth of the stack within the
current `CMakeLists.txt`, so it gets reset across calls to
`add_subdirectory`.

The solution involves adding a field with a "global frame". This value
gets incremented on calls to `add_subdirectory`, which makes it easier
for tools to reconstruct "global stacktraces".

I considered changing the current "frame" value, but I didn't because
it would be a breaking change. I cannot think of any use-case where
"frame" is more useful to "global-frame", but maybe I'm missing
something.
2022-02-07 16:03:22 -05:00
Brad King
4cf80f413b Merge topic 'cmcmd-end-of-options-delimiter'
b10930040d cmcmd: add end of options delimiter to cmake -E commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6934
2022-02-07 12:18:03 -05:00
Brad King
533760ac29 Merge topic 'doc-DESTDIR'
a9b8c9d33e Help: Clarify roles of DESTDIR and CMAKE_INSTALL_PREFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6955
2022-02-07 11:49:26 -05:00
Brad King
a9b8c9d33e Help: Clarify roles of DESTDIR and CMAKE_INSTALL_PREFIX 2022-02-04 15:33:11 -05:00
Brad King
cf68f52875 Merge topic 'ep-patch-USES_TERMINAL'
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6940
2022-02-04 08:18:13 -05:00
Brad King
01b89d2547 Merge topic 'ep-patch-USES_TERMINAL' into release-3.23
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6940
2022-02-04 08:18:12 -05:00
Brad King
c724e8d2bd Merge topic 'rel-version'
bd11d78dfc Help/dev: Clarify maintainer guide step for DEVEL_CMAKE_VERSION
d184bf0659 Replace DEVEL_CMAKE_VERSION with literal 3.23 release version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6951
2022-02-04 08:06:16 -05:00
Brad King
bd11d78dfc Help/dev: Clarify maintainer guide step for DEVEL_CMAKE_VERSION
The previous wording could be misread as ensuring the arguments to the
call match the release version.  Clarify that one needs to remove the
call and replace it with the literal release version string.
2022-02-04 06:48:58 -05:00
Peter Würth
b10930040d cmcmd: add end of options delimiter to cmake -E commands
Implements a -- delimiter, that indicates the end of options (starting
with a dash -) of a command and separates them from the subsequent
operands (positional arguments).

The following commands are affected:
- env: Implemented the -- delimiter.
- cat: The -- delimiter was already kind of considered, but its
  occurence did not stop the options parsing.
- rm: Here the command already implemented the -- delimiter as
  specified, but it was not documented.

Fixes #22970
2022-02-03 21:54:17 +01:00
Brad King
c63ee048cb Merge topic 'doc-cmcmd-versionadded' into release-3.23
892c96dda0 Help: add versionadded markup to cmake -E commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6946
2022-02-03 10:13:28 -05:00
Peter Würth
892c96dda0 Help: add versionadded markup to cmake -E commands 2022-02-03 09:39:56 -05:00
Craig Scott
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword
This brings the patch step into line with all the others which already
had their own `USES_TERMINAL_<step>` keyword. All steps (including
patch) already have their own `LOG_<step>` keyword too, so the lack of
`USES_TERMINAL_PATCH` was inconsistent.
2022-02-03 09:27:35 -05:00
Brad King
823e908d72 Help: Drop development topic notes to prepare release
Release versions do not have the development topic section of
the CMake Release Notes index page.
2022-02-03 09:11:03 -05:00
Brad King
9334b5bd7b Help: Update Sphinx versionadded directives for 3.23 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.22.0 --overwrite

Manually select updates that really belong to the 3.23 release, as
against adding documentation for previously-existing entities.
2022-02-03 07:53:46 -05:00
Brad King
e61969c59e Help: Organize and revise 3.23 release notes
Add section headers similar to the 3.22 release notes and move each
individual bullet into an appropriate section.  Revise a few bullets.
2022-02-03 07:53:46 -05:00
Brad King
f5bdea75a0 Help: Consolidate 3.23 release notes
Run the `Utilities/Release/consolidate-relnotes.bash` script to move
notes from `Help/release/dev/*` into `Help/release/3.23.rst`.
2022-02-03 07:53:45 -05:00
Brad King
ef23e81544 Help: Remove stray leading blank lines from release notes 2022-02-03 07:53:45 -05:00
Brad King
51aaea34d6 Help: Polish CMAKE{,_SYSTEM}_IGNORE_PREFIX_PATH documentation 2022-02-03 07:53:45 -05:00
Brad King
d738939355 Merge topic 'doc-imported-no-system'
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6942
2022-02-03 07:52:46 -05:00
Brad King
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories
Mention that system include directories are searched after normal
include directories.

Document that `IMPORTED_NO_SYSTEM` and `NO_SYSTEM_FROM_IMPORTED`
do not affect `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`.
2022-02-03 06:21:37 -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
18881afbdf Merge branch 'release-3.21' 2022-02-01 12:09:43 -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
6fe5df13c2 CMake 3.21.5 2022-02-01 10:54:10 -05:00
Brad King
983df681c8 Merge topic 'help-try-compile-result-var'
34d263270e Help: Drop incorrect versionadded for try_compile result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6923
2022-02-01 09:50:41 -05:00
Brad King
d647ca1849 Merge branch 'help-try-compile-result-var' into release-3.21
Merge-request: !6923
2022-01-31 11:36:46 -05:00
friendlyanon
34d263270e Help: Drop incorrect versionadded for try_compile result variable
In commit c705279bae (Help: Add `.. versionadded` directives to commands
documentation, 2020-11-08, v3.20.0-rc1~508^2) we accidentally added
``versionadded`` markup suggesting that the first argument to
`try_compile` was fixed as `RESULT_VAR` prior to CMake 3.14.  This was
probably due to misinterpreting the change from commit 7975edeac5 (Help:
User-provided variable names for try_* commands, 2019-02-24,
v3.14.0-rc3~16^2~3).

The result variable has never been fixed.  Drop the incorrect markup.
2022-01-31 10:59:56 -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
Craig Scott
440bd4845b Merge topic 'doc-rel-path-target_include_directories'
3efa3251e9 Help: Clarify relative path handling for target_include_directories()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6924
2022-01-31 01:05:12 -05:00
Craig Scott
3efa3251e9 Help: Clarify relative path handling for target_include_directories()
Fixes: #22853
2022-01-31 16:24:07 +11:00
Craig Scott
f59d255173 Help: Highlight internal nature of linker preference variables
In d2efc90598 (Help: Move linker preference variables to the internal
section, 2022-01-15), the internal nature of the
CMAKE_<LANG>_LINKER_PREFERENCE and
CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES variables was
made clearer. The LINKER_LANGUAGE target property references
the former, but doesn't mention that the variable is internal. Make
the internal nature of the variable and the preference implementation
in general clearer in the LINKER_LANGUAGE docs.
2022-01-30 17:09:04 +11: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
d2f4f17b90 Help: Cross-reference LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES
Document in each property its role in combination with the other.
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
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