1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-07-19 14:04:19 +08:00

1004 Commits

Author SHA1 Message Date
Brad King
dbede7be7e Merge topic 'cmake-sources-no-scan'
91b7bf59a7 cmGlobalXCodeGenerator: disable C++ module scanning for force-lang files
9e19a61ddb cmLocalGenerator: disable C++ module scanning for unity sources
fa9a72a788 cmLocalGenerator: disable C++ module scanning for copied PCH sources
e5dce1a37e cmQtAutoGenInitializer: disable C++ module scanning for autogen sources
4fd596c34c cmGeneratorTarget: disable C++ module scanning for verify targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9064
2023-12-12 08:33:38 -05:00
Ben Boeckel
91b7bf59a7 cmGlobalXCodeGenerator: disable C++ module scanning for force-lang files 2023-12-11 07:54:03 -05:00
Jonathan Earnshaw
2b4bb43ed3 Xcode: Add support to embed XPC Services 2023-11-30 10:09:34 +13:00
Brad King
91d3fe1638 Merge topic 'xcode-embed-resources'
6030df205a Xcode: Fix embed resources prop name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Deal <halx99@live.com>
Merge-request: !9008
2023-11-29 07:50:04 -05:00
halx99
6030df205a Xcode: Fix embed resources prop name
Fix commit e40d2cb3af (Xcode: Add embed resources support, 2023-07-31,
v3.28.0-rc1~281^2).  The implementation should not name the `_PATH`
suffix explicitly.  That variant is automatically handled by
`cmGlobalXCodeGenerator::AddEmbeddedObjects`.
2023-11-28 12:06:29 -05:00
Evan Wilde
c1d787e473 Swift: Add abstraction for compilation mode
Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding
`Swift_COMPILATION_MODE` target property to control the compilation
mode.  Select among `wholemodule`, `singlefile`, and `incremental`.

Add policy CMP0157 to remove the default `-wmo` flags in favor of the
abstract setting.

Issue: #25366
2023-11-17 08:43:21 -05:00
Brad King
49df33c342 Merge topic 'static-library-link-xcframework'
7d19246138 Xcode: Fix linking against .xcframework from static libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8949
2023-11-07 09:56:25 -05:00
Kyle Edwards
7d19246138 Xcode: Fix linking against .xcframework from static libraries
Issue: #21752
2023-11-06 17:40:00 -05:00
Marc Chevrier
96a953b1ed Add options to specify linker tool
Offer the capability, through variable `CMAKE_LINKER_TYPE`, as well as
the target property `LINKER_TYPE` to specify which linker must be used.

The implementation of this capability is specified by variables specific
to the language and linker type: `CMAKE_<LANG>_USING_LINKER_<TYPE>`.
Some definitions are provided as part of `CMake`.

For example, to select the `LLVM` linker rather than the standard one,
the type `LLD` should be specified through the variable `CMAKE_LINKER_TYPE`.
And, on `Apple`, `Linux` and some environments on `Windows`, the variable
`CMAKE_<LANG>_USING_LINKER_LLD` has value `-fuse-ld=lld`. And for `Windows`
environments  based on `MSVC`, where the linker is used directly, the tool
`lld-link.exe` will be used rather than `link.exe`.

Fixes: #19174, #24254, #24990
2023-10-13 11:52:35 +02:00
Ben Boeckel
197a6bf171 cxxmodules: rework control logic for scanning regular C++ sources
Now that scanning support is no longer experimental, the logic for
whether or not to scan C++ 20 sources is now important because all
projects are now exposted to the logic. Make the scanning rules explicit
in the documentation and rework the queries to localize all of the
associated logic.

A policy to handle the ultimate fallback logic will be implemented in a
following commit.
2023-10-02 10:17:31 -04:00
Gregor Jasny
b78a14e204 Xcode: reject legacy buildsystem for Xcode 14
With Xcode 14 support for the Legacy Build System has been removed
and the BuildSystemType in the WorkspaceSettings is ignored.
If CMake still generates projects targeted to the Lecacy Build
System the build preparation phase will likely fail because Xcode
for example misses any declared outputs from script invocations.

This is a hard to debug problem and CMake should reject the invalid
configuration instead.
2023-08-31 10:13:57 +02:00
Brad King
863891adb2 Merge topic 'modules-better-messages'
571b5e1f2c cxxmodules: improve error messages for C++ module setup
8b4d32c18b cmStandardLevelResolver: add query for the effective standard level
17ddc4ac76 cmStandardLevelResolver: compare with static string literals
6f1dae2b01 cmStandardLevelResolver: use `cmStrCat` where possible
0d45d40e13 cmStandardLevelResolver: use character literals where possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8755
2023-08-25 11:27:27 -04:00
Ben Boeckel
571b5e1f2c cxxmodules: improve error messages for C++ module setup
Make it clear that:

- the quoted string is a target name; and
- C++ sources that export modules is the important detail.
2023-08-23 16:47:29 -04:00
Ben Boeckel
e166bbef7b cmComputeLinkInformation: prepare Item consumers for OBJECT libraries
After b665966933 (cmComputeLinkInformation: track `OBJECT` library
dependencies, 2023-07-22), introduced in !8645 as a fix for #25112,
`OBJECT` libraries were tracked in a separate member to reduce the risk
of further regressions. This commit prepares consumers to handle
`OBJECT` libraries once they start appearing as link items.
2023-08-01 10:06:02 -04:00
Brad King
17dcd9424a Merge topic 'xcode-embed-resources'
e40d2cb3af Xcode: Add embed resources support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Deal <halx99@live.com>
Merge-request: !8632
2023-08-01 09:33:15 -04:00
halx99
e40d2cb3af Xcode: Add embed resources support 2023-07-31 09:08:10 +08:00
Ben Boeckel
09b7ac7f67 strings: use single characters where possible 2023-07-30 18:33:07 -04:00
Ben Boeckel
6aa9023700 string_view: use string_view literals in comparisons 2023-07-30 18:33:07 -04:00
Ben Boeckel
1b60137b98 strings: combine string literals 2023-07-30 18:33:07 -04:00
Ben Boeckel
f5d04b5bf0 cmStrCat: use where possible in Apple-specific sources 2023-07-30 18:33:07 -04:00
Ben Boeckel
22bc92fbc1 clang-tidy: fix readability-braces-around-statements lints 2023-07-30 18:33:07 -04:00
Ben Boeckel
1c33464485 clang-tidy: fix readability-else-after-return lints 2023-07-30 18:33:07 -04:00
Ben Boeckel
709c185d8f clang-tidy: fix bugprone-branch-clone lints 2023-07-30 18:33:07 -04:00
Ben Boeckel
efd9398844 clang-tidy: fix modernize-use-default-member-init lints 2023-07-30 18:33:07 -04:00
Ben Boeckel
f5056d28c5 clang-tidy: fix modernize-use-auto lints 2023-07-27 18:35:52 -04:00
Kyle Edwards
7050ac56a1 macOS: Add support for linking against .xcframework folders
Issue: #21752
2023-07-26 17:00:01 -04:00
Gregor Jasny
25977e177b apple: add preliminary visionOS support 2023-07-11 20:20:25 +02:00
Brad King
da27ff1e96 Preserve --compile-no-warning-as-error in automatic CMake re-runs
When the build system re-runs `cmake` to regenerate itself, preserve the
`--compile-no-warning-as-error` option if it was used when `cmake` was
last explicitly invoked.  Normally such settings are preserved in the
cache, but the purpose of this option is to be beyond the reach of
project code.
2023-05-30 17:44:43 -04:00
Brad King
e0b48284a1 Xcode: Internally uses -S instead of -H to specify source directory
This was accidentally left out of commit de962cc00d (CMake: Internally
uses -S instead of -H to specify source directory, 2018-09-06,
v3.13.0-rc1~76^2~1).
2023-05-30 17:22:15 -04:00
Marc Chevrier
ad9020a899 Apple Frameworks: honor SYSTEM target property
Fixes: #24109
2023-05-11 10:24:18 +02:00
Marc Chevrier
241304190f CMake code rely on cmList class for CMake lists management (part. 2) 2023-04-29 09:54:31 +02:00
Marc Chevrier
e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Brad King
43e973eba2 cmGeneratorTarget: Pass language to GetAppleArchs when possible 2023-03-15 10:18:41 -04:00
Brad King
93afe804ce cmGeneratorTarget: Convert GetAppleArchs output argument to return value 2023-03-15 10:11:37 -04:00
Marc Chevrier
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
Fixes: #24123
2023-03-01 12:23:28 +01:00
Brad King
4e39c25fce Merge topic 'xcode-revert-header-map'
841272eb35 Xcode: Restore suppression of header maps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8218
2023-02-20 08:32:11 -05:00
Brad King
841272eb35 Xcode: Restore suppression of header maps
In commit 8527f42b96 (Xcode: Explicitly disable deprecated user include
path feature, 2023-01-31, v3.26.0-rc1~7^2) we dropped the Xcode build
setting `USE_HEADERMAP = NO` because Xcode 14's "Build Documentation"
feature (`xcodebuild RUN_DOCUMENTATION_COMPILER=YES`) fails in some
cases without header maps.  However, enabling header maps causes Xcode
to add `-iquote .../foo.hmap` and `-I .../bar.hmap` flags that can
change the intended header file search order based on the contents of
the header maps.  This can break existing projects.  Restore the
`USE_HEADERMAP = NO` setting to fix the header file search order.

Further investigation will be needed to resolve the problematic cases
with the Xcode 14 "Build Documentation" feature.  Meanwhile projects
encountering such cases can set the `XCODE_ATTRIBUTE_USE_HEADERMAP`
target property to `YES` themselves.

Fixes: #24418
Issue: #24379
2023-02-17 18:02:45 -05:00
Kyle Edwards
480b363724 cmCustomCommand: Refactor custom command-specific policy values
Many custom commands are created by CMake itself rather than by
the user. These custom commands should always have their policies
set to NEW, and user-created custom commands should have their
policy values set only from the state snapshot. In addition, we
want to genericize the mechanism of recording a policy at the time
of custom command creation.

Add a CM_FOR_EACH_CUSTOM_COMMAND_POLICY macro to genericize
custom command policies. Use this to define all custom command
policies. Make all such policies NEW instead of WARN by default.
Remove individual policy modifier methods and add a single method
that records relevant values from a cmStateSnapshot. Remove the
no longer needed explicit policy settings from synthesized custom
commands.
2023-02-06 15:04:16 -05:00
Brad King
8527f42b96 Xcode: Explicitly disable deprecated user include path feature
The `ALWAYS_SEARCH_USER_PATHS` feature is documented [1] to search the
paths in `USER_HEADER_SEARCH_PATHS` before `HEADER_SEARCH_PATHS`.  The
behavior has been long discouraged and was deprecated by Xcode 8.3.
Furthermore, Xcode explicitly disables this setting when creating new
projects.  We can do that too since we do not generate any user header
search paths anyway.

Previously we always set `USE_HEADERMAP` to `NO` to prevent Xcode's
warning about an ancient "header map" feature deprecation.  However,
this somehow breaks Xcode 14's "Build Documentation" feature.  Setting
`ALWAYS_SEARCH_USER_PATHS` to `NO` seems to prevent the header map
warning too, so drop `USE_HEADERMAP` to fix the documentation feature.

[1] https://developer.apple.com/documentation/xcode/build-settings-reference

Fixes: #24379
2023-01-31 14:21:20 -05:00
Ross Kilgariff
01c1d81527 Xcode: Inherit Swift flags and compilation conditions
Extend the change from commit dfaf55fbfd (Xcode: add extra
'$(inherited)' entries using InheritBuildSettingAttribute, 2021-05-03,
v3.21.0-rc1~182^2) to cover Swift flags and compilation conditions,
allowing CocoaPods and CMake to interoperate when used in the same
project.
2023-01-25 15:15:03 -05:00
Pierre Testart
a525f5f1bf cmGeneratorTarget: Cache full name components
Cache the result of cmGeneratorTarget::GetFullNameInternalComponents
to improve performance.
2023-01-18 09:12:17 -05:00
Brad King
84c2518a7b Merge topic 'COMPILE_DEFINITIONS-property-cleanup'
7480fa0a5f COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8004
2022-12-14 09:03:08 -05:00
Marc Chevrier
7480fa0a5f COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases
Fixes: #24186
2022-12-13 16:54:56 +01:00
Rose
6d15754814 Make vector operations more efficient 2022-12-10 12:48:09 -05:00
Brad King
7c462e36c9 Merge topic 'XCode-XCODE_LINK_BUILD_PHASE_MODE-and-LINK_LIBRARY-genex'
61075d2d7b XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7947
2022-11-23 07:08:01 -05:00
Marc Chevrier
61075d2d7b XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE
Fixes: #24176
2022-11-22 16:44:45 +01:00
Brad King
62172b4ab7 Merge topic 'custom-command-comment-genex'
26d813092b add_custom_{command,target}: add genex support for COMMENT
60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7887
2022-11-22 09:47:59 -05:00
Peter Würth
60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string
Refactoring was done because EvaluateComment leaked memory.
2022-11-19 13:32:56 +01:00
Russell Greene
b99c386122 Xcode: Allow bundling extensionkit extensions
Fixes: #24150
2022-11-18 13:58:03 -06:00
Alex Turbov
6e3e8827fa Refactor: cmGlobalGeneratorFactory::GetDocumentation returns entry
Before, a documentation entry was in/out parameter.
Now it's a normal return value.

This also makes possible to eliminate defaulted default ctor
for `cmDocumentationEntry` for C++ 11.

Also, simplify `cmake::AppendGlobalGeneratorsDocumentation()`.
2022-11-17 16:37:13 +04:00