29064 Commits

Author SHA1 Message Date
Brad King
aaa5eab410 CMake 3.18.2 2020-08-20 08:20:32 -04:00
Brad King
5c9edd38c6 Merge topic 'osx-archs-apple-only' into release-3.18
70ce1ad64a PCH: Avoid Apple-specific architecture flags on other platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5118
2020-08-11 08:54:15 -04:00
Brad King
70ce1ad64a PCH: Avoid Apple-specific architecture flags on other platforms
Since commit f593b354da (PCH: Add support for multi architecture iOS
projects, 2020-04-02, v3.18.0-rc1~414^2) the `OSX_ARCHITECTURES` target
property (and corresponding `CMAKE_OSX_ARCHITECTURES` variable) affects
flags on non-Apple platforms by accident.  Add a missing condition to
avoid this.

Fixes: #21072
2020-08-10 13:29:29 -04:00
Brad King
97d581b25d Xcode: Explicitly turn off signing in try_compile projects
Fixes: #18407, #20571, #20688
2020-08-10 14:28:38 +02:00
Brad King
13e5df19fd Merge topic 'reuse_pch_no_delay' into release-3.18
ef97fbe6c2 PCH: Avoid unnecessary 30s delay on MSBuild Generator with REUSE_FROM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5102
2020-08-06 10:39:46 -04:00
Brad King
ab4895d6b2 Merge topic 'automoc_timestamp_deps' into release-3.18
9a9ed4b9d3 Merge branch 'backport-3.17-automoc_timestamp_deps'
7445c9a58a AutoGen: Add test to check for correct AutoMoc dependencies
a79056bb02 AutoGen: Fix over-specified direct dependencies of custom command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Aleix <aleixpol@kde.org>
Merge-request: !5085
2020-08-06 10:31:23 -04:00
Brad King
ce4216dedd Merge topic 'ninja-multi-rsp-remove-path' into release-3.18
cdb50af2f6 Ninja: Restore shorter path to response files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: alcroito <alexandru.croitor@qt.io>
Merge-request: !5094
2020-08-06 10:28:27 -04:00
Cristian Adam
ef97fbe6c2 PCH: Avoid unnecessary 30s delay on MSBuild Generator with REUSE_FROM
Fix logic added by commit 1f791eb160 (Multi-Ninja: Fix reusable PCHs for
MSVC, 2020-05-24, v3.18.0-rc1~72^2) to avoid an unnecessary delay.

Fixes: #21054
2020-08-05 15:52:05 -04:00
Brad King
9a9ed4b9d3 Merge branch 'backport-3.17-automoc_timestamp_deps' 2020-08-05 15:42:39 -04:00
Alexandru Croitor
a79056bb02 AutoGen: Fix over-specified direct dependencies of custom command
The AutoMoc timestamp creating custom command explicitly depended
on all dependencies of the origin target (associated to the AutoGen
target).

When an origin target depended on a shared library 'libfoo.so',
if it was re-linked, the AutoMoc custom command would touch its
output timestamp file, and thus cause needless rebuilding of sources,
despite the shared library not having any influence on the AutoMoc
generated files.

Introduce a new '<target>_autogen_timestamp_deps' utility target,
which will serve as an 'order-only' dependency for the custom command.

This will prevent needless rebuilding, because touching 'libfoo.so'
will not cause the custom command to be re-executed.

The new AutoMoc dependency tree looks like:
    '_autogen_timestamp_deps (serves as order-only dep)'
 <- '<target_autogen>/timestamp' file ( + moc deps file)
 <- '<target>_autogen' target.

Fixes: #21020
2020-08-03 19:38:11 +02:00
Kyle Edwards
cdb50af2f6 Ninja: Restore shorter path to response files
In commit 99ed39b011 (Ninja Multi-Config: Make link response files
per-config, 2020-07-15, v3.17.4~3^2), we added the target directory to
the response file under the mistaken assumption that two different
targets with the same name could be in different directories. However,
this causes the path to the response file to be too long to fit on a
command line.  Take the path back out, while leaving in the per-config
split.

Fixes: #21050
2020-08-03 12:14:16 -04:00
Brad King
63a65baf4c CMake 3.18.1 2020-07-30 12:34:59 -04:00
Brad King
103d6faed9 CMake 3.17.4 2020-07-30 10:30:07 -04:00
Cristian Adam
7051250a6c Unity Builds: Do not set SKIP_AUTOGEN to source files
Fixes: #21028
2020-07-29 17:57:50 +02:00
Brad King
dde97681e9 Merge topic 'revert-add_test-special-chars' into release-3.18
5fc5f4d26e add_test: Revert "Allow special characters in test name"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5067
2020-07-28 08:24:34 -04:00
Brad King
5fc5f4d26e add_test: Revert "Allow special characters in test name"
Revert commit f84af8e270 (add_test: Allow special characters in test
name, 2020-05-16, v3.18.0-rc1~142^2).  Unfortunately the fix breaks
projects that were working around the limitation with manual escaping.
The fix can be re-introduced with a policy in a future version.

Also add a 3.18.1 release note explaining the change.

Fixes: #21017, #20965
Issue: #19391
2020-07-28 08:04:11 +10:00
Brad King
4b0c4ca3d8 Merge topic 'xcode-12-legacy-deprecation' into release-3.18
36fc3a1e84 Xcode: Suppress legacy build system deprecation warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5052
2020-07-27 10:45:14 -04:00
Brad King
e19a62e28b Merge topic 'vs-lang-flags' into release-3.18
c4109a1bc8 VS: Restore toleration of target-wide -TP flag with MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5051
2020-07-27 10:42:44 -04:00
Brad King
36fc3a1e84 Xcode: Suppress legacy build system deprecation warning
Xcode 12 beta 3 now warns about using the legacy build system.
Since generation of the build system is CMake's responsibility,
the warning is not relevant to our users.  Suppress it.

Issue: #18088
2020-07-23 13:00:42 -04:00
Brad King
c4109a1bc8 VS: Restore toleration of target-wide -TP flag with MSVC
Since commit 3b547e2e4b (VS: Simplify logic adding source file C/C++
language flag to MSVC, 2020-05-15, v3.18.0-rc1~139^2~1) we only add a
per-source language selection flag when the source file extension does
not match the compiler's default.  This approach breaks when a project
adds a target-wide `-TP` flag.

Although such projects likely did not work with non-VS generators, we
did support them before in Visual Studio generators.  Add a special case
to tolerate such flags again.

Fixes: #21005
2020-07-23 10:54:35 -04:00
Brad King
4b1c6f908f Merge topic 'cmake-gui-qt-5.14' into release-3.18
af6cf586f6 cmake-gui: Fix crash when built with Qt 5.14 or later

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5045
2020-07-23 08:20:48 -04:00
Brad King
af6cf586f6 cmake-gui: Fix crash when built with Qt 5.14 or later
In commit d7679f6427 (QCMakeCacheView: use non-deprecated List and Set
constructions, 2020-06-10, v3.18.0-rc2~13^2) the conversion of the
`this->properties()` value to QSet is incorrect for Qt 5.14+.  The
problem is that `this->properties()` returns by value, so the range
`this->properties().begin(), this->properties().end()` provides
iterators to two different instances.  Use an intermediate temporary
copy of the value to get a consistent iterator range.

Fixes: #20981
2020-07-22 15:19:51 -04:00
Brad King
c8a6da06d2 Merge topic 'graphviz-restore-per-target' into release-3.18
1829220310 Merge branch 'backport-3.17-graphviz-restore-per-target'
f3a6b4a209 Tests: Cover Graphviz support for per-target dependency graph options
93549b9224 Graphviz: Restore support for per-target dependency graph options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5039
2020-07-22 08:42:36 -04:00
Brad King
e817818926 Merge branch 'backport-3.17-graphviz-restore-per-target' into release-3.17
Merge-request: !5039
2020-07-21 16:35:53 -04:00
Brad King
1829220310 Merge branch 'backport-3.17-graphviz-restore-per-target' 2020-07-21 15:00:52 -04:00
Stephan Rohmen
93549b9224 Graphviz: Restore support for per-target dependency graph options
The behaviors controlled by options `GRAPHVIZ_GENERATE_PER_TARGET` and
`GRAPHVIZ_GENERATE_DEPENDERS` were broken by commit 553658393c (Graphviz:
added test suite, fixes, enhancements, 2019-10-08, v3.17.0-rc1~615^2).
It had not been covered in the test suite previously, and those changes
left out checks for these features from the `default_options` case.

Implement the previously-existing behavior in the new graphviz
generation engine added by the above-mentioned commit.

Fixes: #20928
2020-07-21 14:55:44 -04:00
Brad King
19a0b5c544 Merge topic 'ghs-crash' into release-3.18
5da2c71165 GHS: Fix crash when GHS_NO_SOURCE_GROUP_FILE property is not defined

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5033
2020-07-21 07:26:41 -04:00
Brad King
21bebd2d4b Merge topic 'strdup' into release-3.18
eea0337c7d centos5: Fix FTBFS with strdup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5026
2020-07-21 07:25:02 -04:00
Craig Scott
70dca1813d Merge topic 'xcode-native-arch' into release-3.18
26673bf480 Xcode: Explicitly specify default native architecture on macOS
ce624cfbd4 cmGlobalXCodeGenerator: Save CMAKE_SYSTEM_NAME in member

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5023
2020-07-21 07:19:02 -04:00
Brad King
5da2c71165 GHS: Fix crash when GHS_NO_SOURCE_GROUP_FILE property is not defined
Refactoring in commit 36aba01223 (cmGeneratorTarget::GetProperty: return
cmProp, 2020-04-29, v3.18.0-rc1~246^2) left out a `nullptr` check.

Fixes: #20985
2020-07-20 10:41:41 -04:00
Brad King
26673bf480 Xcode: Explicitly specify default native architecture on macOS
When `CMAKE_OSX_ARCHITECTURES` is not specified, we add the Xcode
setting `ONLY_ACTIVE_ARCH = YES` with the intention of targeting the
native architecture of the host.  However, the default `ARCHS` value
chosen by "Xcode 12 Universal Apps" includes multiple architectures.
Add an explicit `ARCHS` setting with value `$(NATIVE_ARCH_ACTUAL)`
to tell Xcode to use the host's native architecture only.

Fixes: #20893
2020-07-20 10:03:15 -04:00
Brad King
61b0d2c95c Merge topic 'swift-link-iface' into release-3.18
14a5712447 Swift: Fix regression in linking to interface libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5027
2020-07-20 09:56:06 -04:00
Julien Schueller
eea0337c7d centos5: Fix FTBFS with strdup
Since commit f034b0f663 (CMake compilation: do not use compiler
extensions, 2020-03-14, v3.18.0-rc1~494^2) we need to explicitly enable
availability of `strdup`.

Fixes: #20971
2020-07-20 08:21:40 +02:00
Brad King
290a68b94c Merge topic 'ninja-multi-rsp' into release-3.18
99ed39b011 Ninja Multi-Config: Make link response files per-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5020
2020-07-17 08:49:36 -04:00
Brad King
14a5712447 Swift: Fix regression in linking to interface libraries
Since commit 2026915f8f (Swift: Propagate Swift_MODULE_DIRECTORY as include
directory, 2020-02-03, v3.18.0-rc1~547^2) we internally call
`GetAllConfigCompileLanguages` on all directly linked targets without
checking if they are interface libraries that don't compile at all.
That violates an internal assumption and assertion.

Fixes: #20977
2020-07-17 08:26:40 -04:00
Brad King
ce624cfbd4 cmGlobalXCodeGenerator: Save CMAKE_SYSTEM_NAME in member 2020-07-16 14:17:47 -04:00
Brad King
ffe425f768 Merge branch 'ninja-multi-rsp' into release-3.17
Merge-request: !5020
2020-07-16 12:02:54 -04:00
Kyle Edwards
99ed39b011 Ninja Multi-Config: Make link response files per-config
Fixes: #20961
2020-07-16 11:57:46 -04:00
Brad King
d421274e3e CMake 3.18.0 2020-07-15 07:19:20 -04:00
Craig Scott
a335999021 Merge topic 'source_file_props_dedup_scopes' into release-3.18
f6969b917d set_property: Deduplicate source file directory scopes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5009
2020-07-14 18:59:39 -04:00
Brad King
8c6cce27ca Merge topic 'macos-11-file-GET_RUNTIME_DEPENDENCIES' into release-3.18
d9af90504f Tests: Update file(G_R_D) test to make system library optional
c51400033c file: Update GET_RUNTIME_DEPENDENCIES for macOS 11 dylib cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4998
2020-07-14 07:15:11 -04:00
Brad King
2ef6ad0136 Merge topic 'profiling-case-insensitive-command-names' into release-3.18
7cf2f7d2af cmake: Store lowercase command names in profiling output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5007
2020-07-14 07:14:08 -04:00
Alexandru Croitor
f6969b917d set_property: Deduplicate source file directory scopes
A user could specify the same directory scope to set_property()
multiple times, which in conjunction with APPEND would append the
property multiple times.

Make sure to deduplicate scopes across both DIRECTORY and
TARGET_DIRECTORY options, so that a property is only appended
once in such a scenario.

Fixes: #20941
2020-07-13 17:43:17 +02:00
Brad King
c51400033c file: Update GET_RUNTIME_DEPENDENCIES for macOS 11 dylib cache
Starting on macOS 11, the dynamic loader has a builtin cache of
system-provided dylib files.  They do not actually exist on the
filesystem.  However, runtime dependencies recorded in Mach-O binaries
can still have `LC_LOAD_DYLIB` entries referring to such dylib files by
absolute path.  The dynamic loader simply resolves the paths from its
cache.  Teach `file(GET_RUNTIME_DEPENDENCIES)` to skip dependencies on
such dylib paths.  For practical software distribution purposes they do
not exist, or at least can be assumed available on all deployments.

Issue: #20863
2020-07-13 08:31:59 -04:00
Brad King
46f1fa01da Merge topic 'imported-local-target-alias' into release-3.18
7b0f6508a0 ALIAS targets: Non-global aliases must be propagated to sub-directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5002
2020-07-13 07:56:13 -04:00
Craig Scott
7cf2f7d2af cmake: Store lowercase command names in profiling output
This ensures commands can be properly aggregated by tools
processing the profiling output.

Fixes: #20946
2020-07-13 11:03:05 +10:00
Marc Chevrier
7b0f6508a0 ALIAS targets: Non-global aliases must be propagated to sub-directories
Fixes: #20942
2020-07-11 16:59:50 +02:00
Craig Scott
9c3beb532f cmake: Show supported formats in --help output for --profiling-format
Fixes: #20943
2020-07-11 23:14:03 +10:00
Brad King
6ab08c4e99 CMake 3.18.0-rc4 2020-07-10 06:49:28 -04:00
Alexandru Croitor
1235f2d747 set_property: Allow both DIRECTORY and TARGET_DIRECTORY together
Allow to specify both DIRECTORY and TARGET_DIRECTORY at the same time in
`set_source_files_properties()` and `set_property(SOURCE)` commands.

Add test cases and update the documentation.

Fixes: #20932
2020-07-09 06:33:52 -04:00