Commit Graph

32495 Commits

Author SHA1 Message Date
Brad King
c3793b4157 CMake 3.24.1 2022-08-17 12:54:57 -04:00
Brad King
349071d6ab Merge topic 'export-no-shdeps' into release-3.24
0ebff0d61a export: Restore exclusion of private shared library dependencies from checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7557
2022-08-16 12:42:20 -04:00
Brad King
0ebff0d61a export: Restore exclusion of private shared library dependencies from checks
Refactoring in commit 8c65b7042e (cmExportFileGenerator: Simplify
collection of targets missing from export set, 2022-04-11,
v3.24.0-rc1~281^2) accidentally dropped the behavior change from
commit 0ad2a1c181 (Export: Never treat private link libraries as
public package dependencies., 2013-09-24, v3.0.0-rc1~559^2).
Restore the behavior and add a test.

Fixes: #23838
2022-08-15 10:40:03 -04:00
Albert Astals Cid
844244ccdc automoc: avoid compiler warnings in linker-warning-silencing code
Revise the code added by !7296 (merged).
Make cmake_automoc_silence_linker_warning less warning-y.
Fix weak-tables clang warning and copyable-polymorph clazy warning.

Fixes: #23823
2022-08-10 22:03:11 +02:00
Brad King
4be24f031a CMake 3.24.0 2022-08-04 09:53:57 -04:00
Brad King
5e0b06fe84 Makefiles: Restore path consistency in the global dispatch makefile
Directory-level rules in `CMakeFiles/Makefile2` were previously
previously written by each directory's local generator using its own
decision for using relative or absolute paths.

Since commit d33b12d84b (Add support for build tree symlink inside
source tree, 2022-02-25, v3.24.0-rc1~583^2), each local generator
explicitly models the relationship between its source and build paths,
and uses this to determine when it is safe to use relative paths.
Because `add_subdirectory` supports arbitrary placement of the source
and build directories, different local generators may have different
relationships between their source and build paths.  This can cause
disagreement among rules written to `CMakeFiles/Makefile2`.

Restore consistency by always using the root local generator to write
rules to `CMakeFiles/Makefile2`.  Relative paths should always be
expressed w.r.t. the top-level build directory since that is the working
directory in which the `make` tool processing the file will run.

Fixes: #23814
2022-08-03 14:58:47 -04:00
Kyle Edwards
83e44002ae VERIFY_INTERFACE_HEADER_SETS: Add verification target for all
Fixes: #23802
2022-08-03 08:19:08 -04:00
Brad King
e18fb0c73e Merge topic 'vs-msbuild-arm64' into release-3.24
c165dd6a83 VS: Fix ARM64 host architecture detection in x86 binary

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7525
2022-08-02 09:30:03 -04:00
Brad King
a4f1c0fac8 Windows: Revert "Prefer junctions for directory symlinks"
Revert commit 5101d586c4 (Windows: Prefer junctions for directory
symlinks, 2022-02-22, v3.24.0-rc1~575^2).  Junctions do not support
`../` and other non-canonical paths.  Revert their use pending further
investigation.

Fixes: #23781
Issue: #23257
2022-08-01 10:59:20 -04:00
Anton Lapounov
c165dd6a83 VS: Fix ARM64 host architecture detection in x86 binary
Use the 64-bit registry view when we check whether Windows
has the ARM64 version of the .NET Framework 4.x installed.

Issue: #23755
2022-08-01 10:16:14 -04:00
Brad King
5ead1d0a25 CMake 3.24.0-rc5 2022-07-28 13:19:49 -04:00
Brad King
12830cc2a9 Merge topic 'verify-interface-header-sets-interface-library-source-language' into release-3.24
41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7517
2022-07-28 08:12:09 -04:00
Brad King
75647fc53d Merge topic 'verify-interface-header-sets-add-compile-definitions' into release-3.24
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7516
2022-07-28 08:11:18 -04:00
Kyle Edwards
41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages
If a target doesn't have any source files, fall back to the global
list of enabled languages to determine the language of the header
file to verify.

Fixes: #23774
2022-07-27 13:29:09 -04:00
Kyle Edwards
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
Fixes: #23732
2022-07-27 12:25:15 -04:00
Kyle Edwards
626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo() 2022-07-27 12:24:53 -04:00
Brad King
418fd85569 VS: Detect ARM64 host architecture at runtime
We use the host machine's architecture to select the `MSBuild.exe`
binary variant, and the host toolset architecture.  When CMake is
compiled as `x64` or `x86` it may still run on ARM64 hosts.  Detect the
actual architecture of the host at runtime instead of relying on the
architecture of CMake's own binary.

The `arm64/MSBuild.exe` executable is an ARM64 .NET 4 application, which
requires the ARM64 version of .NET Framework 4.8.1 to be installed on
the machine.  That version is not yet released for Windows 10; however,
the `MSBuild/Current/Bin/arm64` directory is still created when
installing Visual Studio 2022 (a user may upgrade to Windows 11 later).
Use it only if the .NET Framework is installed.

The `amd64/MSBuild.exe` executable cannot run on Windows 10 ARM64,
but can run on Windows 11 ARM64.

Fixes: #23755
2022-07-27 07:40:46 -04:00
Brad King
ee047a68f2 cmSystemTools: Factor out method to get Windows OS version
Factor the implementation out of `cmGlobalGenerator`.
2022-07-25 14:27:24 -04:00
Brad King
7ed8c2de6a Merge topic 'cmake-help-flags-after-dashdash' into release-3.24
14a0e750cb cmake: In -P mode ignore flags like `--version` after `--`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7496
2022-07-25 12:00:38 -04:00
Brad King
7c9bda81bd Merge topic 'cmake-P-path-args' into release-3.24
febe3190f0 Merge branch 'backport-3.23-cmake-P-path-args'
846a650ff7 cmake: In -P mode ignore extra paths on the command line
c362cba566 cmake: simplify to a single source of truth of working mode
261fa5db39 cmake: In -P mode ignore extra paths on the command line
314135cdf1 cmake: simplify to a single source of truth of working mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7494
2022-07-25 11:57:47 -04:00
Brad King
cba5652a1f Merge topic 'revert-vs-ZERO_CHECK-proj' into release-3.24
289932ded0 VS: Revert "Write ZERO_CHECK.proj for VS19 and above"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7499
2022-07-25 11:56:29 -04:00
Robert Maynard
14a0e750cb cmake: In -P mode ignore flags like --version after --
Fixes: #21031
2022-07-22 14:30:21 -04:00
Robert Maynard
846a650ff7 cmake: In -P mode ignore extra paths on the command line
Fixes: #23748
2022-07-22 13:55:52 -04:00
Robert Maynard
c362cba566 cmake: simplify to a single source of truth of working mode 2022-07-22 13:55:45 -04:00
Brad King
289932ded0 VS: Revert "Write ZERO_CHECK.proj for VS19 and above"
Revert commit a334f1b906 (VS: Write ZERO_CHECK.proj for VS19 and above,
2021-12-24, v3.24.0-rc1~607^2) and a supporting change from
commit 7219988b00 (VS: Exclude ZERO_CHECK.proj from .sln for
include_external_msproject, 2022-07-15, v3.24.0-rc4~1^2).

The change was made to support `dotnet` tooling in addition to
`msbuild`.  However, not having `ZERO_CHECK` in the `.sln` breaks common
interactive workflows.  Revert the change for now.  Later it can be
re-introduced behind some kind of option that enables `dotnet` support.

Fixes: #23726
Issue: #20227
2022-07-22 12:54:20 -04:00
Brad King
778aaf6fdc AUTOUIC: Revert "Fix internal paths of generated ui_foo.h files"
Revert commit 10668f26c9 (AUTOUIC: Fix internal paths of generated
ui_foo.h files, 2022-05-21, v3.24.0-rc3~20^2).  It broke some existing
projects that use more than one `.ui` file of the same name.

Fixes: #23759
Issue: #23523
2022-07-22 11:48:40 -04:00
Brad King
9306a5ab28 CMake 3.24.0-rc4 2022-07-20 09:33:55 -04:00
Sumit Bhardwaj
7219988b00 VS: Exclude ZERO_CHECK.proj from .sln for include_external_msproject
In `cmGlobalVisualStudio7Generator::WriteTargetsToSolution`, we skip
writing `ZERO_CHECK.proj` to solution file as the check in
`cmGlobalVisualStudioGenerator::IsInSolution` returns `false` for
`ZERO_CHECK`. However, we write ZERO_CHECK to ProjectDependencies for
external projects as there are no checks in
`cmGlobalVisualStudio71Generator::WriteExternalProject`.

Similar to `cmGlobalVisualStudioGenerator::IsInSolution`, we introduce
`IsDepInSolution(const std::string&)` which excludes `ZERO_CHECK.proj`
from being added to sln file for the cases where we have `ZERO_CHECK.proj`.

Fixes: #23708
2022-07-20 08:51:38 -04:00
Kyle Edwards
df559cd8c8 Merge topic 'export-try-compile-crash' into release-3.24
29c7546a61 cmGlobalGenerator: Only compute build files for all targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7472
2022-07-14 09:56:03 -04:00
Kyle Edwards
29c7546a61 cmGlobalGenerator: Only compute build files for all targets
If we're creating generation objects for imported targets only, we
don't need the export sets. Only compute build file generators
if generating for all targets.

Fixes: #23709
2022-07-13 11:34:34 -04:00
Brad King
95cce32470 CMake 3.24.0-rc3 2022-07-07 11:02:54 -04:00
Brad King
18a3ee6885 Merge topic 'ccmake-fix-pdcurses-windows' into release-3.24
a78d10220c ccmake: Fix mangled configuration log with PDCurses on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7458
2022-07-07 09:13:12 -04:00
Brad King
5970536e16 Merge topic 'genex-LINK_LIBRARY-check-supported-properties' into release-3.24
913ea78d7a Genex LINK_LIBRARY and LINK_GROUP: check supported properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7454
2022-07-07 09:07:00 -04:00
Duncan Ogilvie
a78d10220c ccmake: Fix mangled configuration log with PDCurses on Windows
This fix seems to work on both Windows and Ubuntu (WSL).

Issue: #18053
2022-07-06 12:14:47 -04:00
Marc Chevrier
913ea78d7a Genex LINK_LIBRARY and LINK_GROUP: check supported properties
Refines check for properties supporting these genex.
Enhance error message.

Fixes: #23699
2022-07-06 16:15:43 +02:00
Marc Chevrier
e8792da04b genex-LINK_LIBRARY: ensure correct generation inside LINK_GROUP genex
This fix ensures the following pattern is correctly handled:
$<LINK_GROUP:group_feat,$<LINK_LIBRARY:lib_feat,mylib>>

With:
CMAKE_LINK_GROUP_USING_group_feat = "—START_GROUP" "—END_GROUP"
CMAKE_LINK_LIBRARY_USING_lib_feat = "—PREFIX" "—LINK <LIBRARY>" "—SUFFIX"

Before the fix, we get the following generation:
—START_GROUP —PREFIX —LINK /path/to/mylib —END_GROUP —SUFFIX
—END_GROUP and —SUFFIX are in the wrong order

After the fix, we get the correct order:
—START_GROUP —PREFIX —LINK /path/to/mylib —SUFFIX —END_GROUP
2022-07-05 10:00:04 +02:00
Ben Leadbetter
8bd98b8117 Genex: Fix TARGET_BUNDLE_DIR_NAME incorrect extension
Fix the genex from commit 997af2e1a6 (Genex: Add TARGET_BUNDLE_DIR_NAME,
2022-04-14, v3.24.0-rc1~233^2) to use the correct bundle directory
extension for each bundle type.

Fixes: #23683
2022-07-01 08:18:10 -04:00
Brad King
529004738a Merge branch 'file-set-crash' into release-3.23
Merge-request: !7420
2022-06-30 08:22:27 -04:00
Brad King
6bc597b30e Merge topic 'file-set-crash' into release-3.24
3fee5398bd install(EXPORT): Check for missing file sets at generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7420
2022-06-30 08:20:23 -04:00
Kyle Edwards
3fee5398bd install(EXPORT): Check for missing file sets at generate time
Missing file sets were originally checked at configure time in
install(TARGETS ... EXPORT), but were not checked at generate time. If
a file set was added after install(TARGETS ... EXPORT) was called,
an abortion error was thrown. Check again at generate time to gracefully
display an error message instead of crashing.

Fixes: #23680
2022-06-29 15:05:32 -04:00
Brad King
18c0ff66b2 Merge topic 'fix-23523' into release-3.24
10668f26c9 AUTOUIC: Fix internal paths of generated ui_foo.h files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7419
2022-06-29 08:43:27 -04:00
Josiah Bills
10668f26c9 AUTOUIC: Fix internal paths of generated ui_foo.h files
For every file foo.ui we generate a ui_foo.h file in
${target}_autogen/include or ${target}_autogen/include_$<CONFIG> in the
multi-config case.  Even .ui files in subdirectories are handled this
way.  That means, .ui files with the same base name will conflict in a
target.

However, for .ui files in subdirectories we added generated sources with
the nonexistent path ${target}_autogen/include/subdir/ui_foo.h.  This
patch fixes that.

Also, CMake will now yield an error if a target has multiple .ui files
with the same base name.

Fixes #23523
2022-06-28 17:26:28 +02:00
Brad King
8c562ece28 CMake 3.24.0-rc2 2022-06-23 10:58:01 -04:00
Brad King
9a0a94fdaa VS: Add variable to to turn off Visual Studio compile batching
Extend the change from commit b764c7c273 (VS: Add property to turn off
Visual Studio compile batching, 2022-02-07, v3.24.0-rc1~710^2) by
adding a variable to initialize the property on every target.

Issue: #23179
Fixes: #23639
2022-06-22 12:07:03 -04:00
Brad King
dc67ae7cd3 Merge topic 'use-arm64-msbuild' into release-3.24
80273514aa VS: Prefer ARM64 MSBuild on Windows ARM64 host

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7381
2022-06-22 08:48:32 -04:00
Tommy Vercetti
80273514aa VS: Prefer ARM64 MSBuild on Windows ARM64 host
Fixes: #23629
2022-06-21 10:56:42 -04:00
Gregor Jasny
116cc5a57b cm_cxx_features: filter out warnings from Xcode 14
```
xcodebuild[13070:54426] [MT] DVTSDK: Warning: SDK path collision for path
```
2022-06-21 10:48:37 -04:00
Brad King
3b4bd019ff CMake 3.24.0-rc1 2022-06-14 12:11:11 -04:00
Brad King
c1957df97a Merge topic 'lcc-warnings' into release-3.24
beb07cdda7 Source: Convince LCC that RAII variables are used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7357
2022-06-14 07:35:20 -04:00
Brad King
beb07cdda7 Source: Convince LCC that RAII variables are used
Extend the change from commit 5ad8862318 (Source: Convince NVHPC that
RAII variables are used, 2021-04-26, v3.21.0-rc1~254^2~1) to apply to
LCC too.
2022-06-13 11:07:35 -04:00