summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Refactor: `cmGlobalGeneratorFactory::GetDocumentation` returns entryAlex Turbov2022-11-171-6/+5
| | | | | | | | | | | | | | | | | | | | 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()`.
* | Merge topic 'xcode-swift-include-dirs'Brad King2022-11-031-10/+15
|\ \ | |/ | | | | | | | | | | | | cb4e6702b2 Xcode: Implement Swift include directories e1ccab12d7 Xcode: Restore Swift framework search directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7858
| * Xcode: Implement Swift include directoriesBrad King2022-11-021-0/+3
| | | | | | | | | | | | | | Populate Xcode's `SWIFT_INCLUDE_PATHS` build setting with the target-wide include directories. Issue: #24116
| * Xcode: Restore Swift framework search directoriesBrad King2022-11-021-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Previously we selected a single "language for preprocessor" with which to compute both target-wide `GCC_PREPROCESSOR_DEFINITIONS` and `{HEADER,FRAMEWORK}_SEARCH_PATHS`. Since commit c0dd3dd2c1 (Xcode: Evaluate Swift compile definitions separately, 2022-10-25, v3.25.0-rc3~16^2) we never compute `GCC_PREPROCESSOR_DEFINITIONS` for Swift. Therefore we need to select the language for target-wide include and framework directories separately. Fixes: #24116
* | Merge topic 'xcode-obj-dir'Brad King2022-10-311-8/+21
|\ \ | |/ | | | | | | | | | | 024e3d2bf6 Xcode: Put object files in a place that Xcode cleans Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7843
| * Xcode: Put object files in a place that Xcode cleansBrad King2022-10-281-8/+21
| | | | | | | | | | | | | | | | | | Since commit dc5fc898f6 (Xcode: Set object file locations using TARGET_TEMP_DIR, 2022-09-29, v3.25.0-rc1~64^2~1), `xcodebuild clean` does not remove the object files in our explicit `TARGET_TEMP_DIR` because it is not under the `SYMROOT`. Put it there. Fixes: #24096
* | Merge topic 'xcode-restore-install-path'Brad King2022-10-281-3/+3
|\ \ | |/ | | | | | | | | | | 8d5631f0d0 Xcode: Revert "Don't set INSTALL_PATH unless target is SHARED_LIBRARY" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7839
| * Xcode: Revert "Don't set INSTALL_PATH unless target is SHARED_LIBRARY"Brad King2022-10-271-3/+3
| | | | | | | | | | | | | | | | | | The change in commit 61acaa12af (xcode: Don't set INSTALL_PATH unless target is SHARED_LIBRARY, 2022-07-14, v3.25.0-rc1~291^2) breaks some existing use cases. Revert it pending further investigation. Fixes: #24087 Issue: #15183
* | Merge topic 'xcode-swift-defs'Brad King2022-10-271-11/+32
|\ \ | |/ | | | | | | | | | | c0dd3dd2c1 Xcode: Evaluate Swift compile definitions separately Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7826
| * Xcode: Evaluate Swift compile definitions separatelyBrad King2022-10-251-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xcode has a separate setting for Swift compile definitions, so we can compute a dedicated value for it. Therefore we can: * Support the COMPILE_LANGUAGE generator expression for Swift-specific filters. * Avoid passing the `=value` part of definitions, which Swift does not support. This revises commit 5cb625eb2f (Xcode: Pass compile definitions to Swift, 2022-06-19, v3.25.0-rc1~493^2) and reverts commit 12c6fec6b4 (Xcode: Drop CMAKE_INTDIR= definition in Swift targets, 2022-09-30, v3.25.0-rc1~60^2~2), as the latter is no longer needed. Fixes: #24086
* | Merge topic 'swift-default-flags'Brad King2022-10-171-0/+8
|\ \ | |/ |/| | | | | | | | | | | 238e0f25b2 Xcode: Set WMO on non-debug build configurations 6063428de7 Swift: Update default build flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7741
| * Xcode: Set WMO on non-debug build configurationsEvan Wilde2022-10-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the swift compilation mode to wholemodule in the xcode generator for all non-debug build configurations at the project level. Leaving the target build-configurations default ensures that this default can be overridden easily by editing either the project configuration from the build settings editor or the per-target configuration. When set on versions of Xcode that do not recognize the `SWIFT_COMPILATION_MODE` setting, Xcode will include the option as a user-defined setting, but otherwise ignore it.
* | Xcode: ensure framework with custom output directory can be consumedMarc Chevrier2022-10-141-5/+13
|/ | | | Fixes: #24046
* Merge topic 'ci-xcode-14.0'Brad King2022-10-031-2/+7
|\ | | | | | | | | | | | | | | | | 9cdf4c9be4 gitlab-ci: update macOS jobs to use Xcode 14.0 5d2c2b2558 Tests: Update RunCMake.XcodeProject iOS cases for Xcode 14.0 12c6fec6b4 Xcode: Drop CMAKE_INTDIR= definition in Swift targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7732
| * Xcode: Drop CMAKE_INTDIR= definition in Swift targetsBrad King2022-09-301-2/+7
| | | | | | | | | | Xcode 14.0 warns that Swift doesn't support definition values. Therefore `CMAKE_INTDIR` is not useful to Swift sources. Drop it.
* | Xcode: Fix "clean" operation under the "new build system"Brad King2022-09-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we set `SYMROOT` to tell Xcode where to place the build products. However, the "clean" operation in the Xcode "new build system" expects that only Xcode creates the `SYMROOT` directory or contents inside it. Since we create that directory, "clean" fails. We now explicitly set `CONFIGURATION_BUILD_DIR` and `TARGET_TEMP_DIR` instead of letting Xcode compute their values from `SYMROOT`, so we no longer need to set the latter. Drop the now-unnecessary `SYMROOT`. Fixes: #22550
* | Xcode: Set object file locations using TARGET_TEMP_DIRBrad King2022-09-291-26/+12
| | | | | | | | | | | | This avoids relying on `SYMROOT` to locate the object files. Issue: #22550
* | Xcode: Set build product locations using CONFIGURATION_BUILD_DIRBrad King2022-09-291-11/+13
| | | | | | | | | | | | | | | | | | | | Since commit 59a2265576 (Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir, 2011-08-12, v2.8.6~43^2~1) we can now set the build products path using `CONFIGURATION_BUILD_DIR` unconditionally because we compute the correct value even when using `EFFECTIVE_PLATFORM_NAME`. This avoids relying on `SYMROOT` to locate the build products. Issue: #22550
* | cmGlobalXCodeGenerator: Remove unused local variable settingsBrad King2022-09-291-4/+0
| |
* | Genex LINK_LIBRARY: Add support for framework with postfixMarc Chevrier2022-09-211-19/+17
| |
* | Merge topic 'xcode-lib-dirs'Brad King2022-09-161-2/+8
|\ \ | | | | | | | | | | | | | | | | | | d4cc39842e Xcode: Do not append per-config suffixes to library search paths Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7672
| * | Xcode: Do not append per-config suffixes to library search pathsMikko Sivulainen2022-09-151-2/+8
| | | | | | | | | | | | | | | | | | | | | Add policy `CMP0142` to remove the automatic addition of the `$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)` suffix in a compatible way. Fixes: #21757
* | | Merge topic 'link-framework-with-multi-config-postfix'Brad King2022-09-151-3/+11
|\ \ \ | |/ / |/| / | |/ | | | | | | fc06450ff4 Apple: Fix regression when linking a framework with postfix Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7675
| * Apple: Fix regression when linking a framework with postfixMarc Chevrier2022-09-141-3/+11
| | | | | | | | | | | | | | Fix a regression caused by commit 40178f3c90 (cmGlobalGenerator: Add helper to split framework path, 2022-02-10, v3.24.0-rc1~661^2~1). Fixes: #23961
* | Merge branch 'backport-3.24-Link-MACOSX_BUNDLE' into Link-MACOSX_BUNDLEMarc Chevrier2022-08-311-0/+1
|\ \ | |/
| * Xcode: Fix erroneous MACOSX_BUNDLE linkMarc Chevrier2022-08-311-0/+1
| | | | | | | | | | | | | | | | Refactoring in commit a2cfa2da4f (GenEx/LINK_LIBRARY: Add features for framework support on Apple, 2022-02-10, v3.24.0-rc1~661^2) accidentally removed a `GetParentDirectory` call. Restore it. Fixes: #23891
* | xcode: Don't set INSTALL_PATH unless target is SHARED_LIBRARYTor Arne Vestbø2022-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An empty INSTALL_PATH will confuse Xcode, resulting in the archive action producing archives that can not be uploaded to the App Store. The logic to pull out a install_name_dir only applies to SHARED_LIBRARY targets, so we can skip the setting of the property for all other targets. There might be cases where the INSTALL_PATH code path will also end up setting an empty INSTALL_PATH, but it's unclear whether this is a problem, so to keep the patch minimal the existing code is left as is. Fixes: #15183
* | CUDA: Add Device LTO support for nvccRobert Maynard2022-07-221-2/+2
| | | | | | | | Fixes #22200