summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Xcode: Fix PCH support with Swift & C++Mikko Lehtonen2024-01-301-1/+2
| | | | | | | Previously, when a mixed language target ends up with `Swift` as the `LINKER_LANGUAGE`, the PCH file was not set for the target at all. Fixes: #21224
* Merge topic 'cmake-sources-no-scan'Brad King2023-12-121-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * cmGlobalXCodeGenerator: disable C++ module scanning for force-lang filesBen Boeckel2023-12-111-0/+1
| |
* | Xcode: Add support to embed XPC ServicesJonathan Earnshaw2023-11-291-0/+10
| |
* | Merge topic 'xcode-embed-resources'Brad King2023-11-291-3/+2
|\ \ | |/ | | | | | | | | | | | | 6030df205a Xcode: Fix embed resources prop name Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Deal <halx99@live.com> Merge-request: !9008
| * Xcode: Fix embed resources prop namehalx992023-11-281-3/+2
| | | | | | | | | | | | | | 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`.
* | Swift: Add abstraction for compilation modeEvan Wilde2023-11-171-3/+33
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge topic 'static-library-link-xcframework'Brad King2023-11-071-21/+72
|\ \ | |/ | | | | | | | | | | 7d19246138 Xcode: Fix linking against .xcframework from static libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8949
| * Xcode: Fix linking against .xcframework from static librariesKyle Edwards2023-11-061-21/+72
| | | | | | | | Issue: #21752
* | Add options to specify linker toolMarc Chevrier2023-10-131-0/+3
|/ | | | | | | | | | | | | | | | | | 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
* cxxmodules: rework control logic for scanning regular C++ sourcesBen Boeckel2023-10-021-8/+0
| | | | | | | | | | | 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.
* Xcode: reject legacy buildsystem for Xcode 14Gregor Jasny2023-08-311-2/+4
| | | | | | | | | | | 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.
* Merge topic 'modules-better-messages'Brad King2023-08-251-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * cxxmodules: improve error messages for C++ module setupBen Boeckel2023-08-231-2/+2
| | | | | | | | | | | | | | Make it clear that: - the quoted string is a target name; and - C++ sources that export modules is the important detail.
* | cmComputeLinkInformation: prepare Item consumers for `OBJECT` librariesBen Boeckel2023-08-011-0/+7
| | | | | | | | | | | | | | | | 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.
* | Merge topic 'xcode-embed-resources'Brad King2023-08-011-4/+30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Xcode: Add embed resources supporthalx992023-07-311-4/+30
| | |
* | | strings: use single characters where possibleBen Boeckel2023-07-301-41/+41
| | |
* | | string_view: use string_view literals in comparisonsBen Boeckel2023-07-301-63/+63
| | |
* | | strings: combine string literalsBen Boeckel2023-07-301-25/+27
| | |
* | | cmStrCat: use where possible in Apple-specific sourcesBen Boeckel2023-07-301-36/+36
| | |
* | | clang-tidy: fix `readability-braces-around-statements` lintsBen Boeckel2023-07-301-1/+2
| | |
* | | clang-tidy: fix `readability-else-after-return` lintsBen Boeckel2023-07-301-3/+3
| | |
* | | clang-tidy: fix `bugprone-branch-clone` lintsBen Boeckel2023-07-301-0/+2
| | |
* | | clang-tidy: fix `modernize-use-default-member-init` lintsBen Boeckel2023-07-301-4/+2
| | |
* | | clang-tidy: fix `modernize-use-auto` lintsBen Boeckel2023-07-271-29/+29
| | |
* | | macOS: Add support for linking against .xcframework foldersKyle Edwards2023-07-261-6/+57
|/ / | | | | | | Issue: #21752
* | apple: add preliminary visionOS supportGregor Jasny2023-07-111-0/+4
|/
* Preserve --compile-no-warning-as-error in automatic CMake re-runsBrad King2023-05-301-8/+6
| | | | | | | | 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.
* Xcode: Internally uses -S instead of -H to specify source directoryBrad King2023-05-301-1/+1
| | | | | | 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).
* Apple Frameworks: honor SYSTEM target propertyMarc Chevrier2023-05-111-3/+1
| | | | Fixes: #24109
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-5/+4
|
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-10/+11
|
* cmGeneratorTarget: Pass language to GetAppleArchs when possibleBrad King2023-03-151-1/+2
|
* cmGeneratorTarget: Convert GetAppleArchs output argument to return valueBrad King2023-03-151-2/+1
|
* Apple: Handle generation and comsuption of text-based stubs (.tbd files)Marc Chevrier2023-03-011-1/+28
| | | | Fixes: #24123
* Merge topic 'xcode-revert-header-map'Brad King2023-02-201-0/+1
|\ | | | | | | | | | | | | 841272eb35 Xcode: Restore suppression of header maps Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8218
| * Xcode: Restore suppression of header mapsBrad King2023-02-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cmCustomCommand: Refactor custom command-specific policy valuesKyle Edwards2023-02-061-3/+0
|/ | | | | | | | | | | | | | | | | 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.
* Xcode: Explicitly disable deprecated user include path featureBrad King2023-01-311-1/+2
| | | | | | | | | | | | | | | | | | | 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
* Xcode: Inherit Swift flags and compilation conditionsRoss Kilgariff2023-01-251-0/+3
| | | | | | | | 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.
* cmGeneratorTarget: Cache full name componentsPierre Testart2023-01-181-10/+8
| | | | | Cache the result of cmGeneratorTarget::GetFullNameInternalComponents to improve performance.
* Merge topic 'COMPILE_DEFINITIONS-property-cleanup'Brad King2022-12-141-1/+7
|\ | | | | | | | | | | | | | | 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
| * COMPILE_DEFINITIONS property: ensure leading -D is removed in all casesMarc Chevrier2022-12-131-1/+7
| | | | | | | | Fixes: #24186
* | Make vector operations more efficientRose2022-12-101-2/+2
|/
* Merge topic 'XCode-XCODE_LINK_BUILD_PHASE_MODE-and-LINK_LIBRARY-genex'Brad King2022-11-231-21/+53
|\ | | | | | | | | | | | | 61075d2d7b XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7947
| * XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODEMarc Chevrier2022-11-221-21/+53
| | | | | | | | Fixes: #24176
* | Merge topic 'custom-command-comment-genex'Brad King2022-11-221-2/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | cmCustomCommandGenerator: refactor GetComment to return std::stringPeter Würth2022-11-191-2/+3
| | | | | | | | | | | | Refactoring was done because EvaluateComment leaked memory.
* | | Xcode: Allow bundling extensionkit extensionsRussell Greene2022-11-181-2/+15
|/ / | | | | | | Fixes: #24150