summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'xcode-framework-quoting' into release-3.20Brad King2021-03-111-1/+1
|\ | | | | | | | | | | | | 4f9a71974e Xcode: Restore support for spaces in framework names Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5899
| * Xcode: Restore support for spaces in framework namesBrad King2021-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | In commit ce2dee9e5b (Xcode: Don't add framework as -framework argument in linker info list, 2020-09-28, v3.19.0-rc1~47^2) we split up the path to a framework into the directory and framework name parts, but only retained the quoting on the directory part. Restore quoting of the framework name. Fixes: #21910
* | cmCustomCommand: Record value of CMP0116 at time of creationKyle Edwards2021-02-231-7/+9
| |
* | Merge topic 'xcode-framework-path'Brad King2021-02-041-1/+14
|\ \ | |/ | | | | | | | | | | | | | | 5389bb4274 Xcode: Don't hard-code SDK-provided implicit framework search paths df08f8df30 cmComputeLinkInformation: Fix misspelt private variable name 375b307bae Apple: Fix linking to frameworks that do not exist until build time Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5760
| * Xcode: Don't hard-code SDK-provided implicit framework search pathsCraig Scott2021-02-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | When a framework is linked to a target by its full path and that framework is located in one of the implicit framework search directories, CMake 3.18.5 and earlier discarded that path. ce2dee9e5ba (Xcode: Don't add framework as -framework argument in linker info list, 2020-09-28) introduced a regression which resulted in the framework path always being added to the search path even if it matched one of the implicit search paths. This broke the ability to do device and simulator builds from the same configured project. Fixes: #21678
* | iOS: Fix compilation of CMake itselfHayden2021-02-021-2/+5
| | | | | | | | There are no ApplicationServices on iOS.
* | Merge topic 'xcode-object-ids'Brad King2021-01-081-12/+45
|\ \ | |/ | | | | | | | | | | | | | | b8b6573db8 Xcode: Use deterministic object ids for script build phases 2892228dc9 cmGlobalXCodeGenerator: Add infrastructure for deterministic object ids d250b67722 cmGlobalXCodeGenerator: Adopt pbxproj object id generation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5671
| * Xcode: Use deterministic object ids for script build phasesBrad King2021-01-061-9/+12
| | | | | | | | | | | | | | | | | | | | The Xcode "new build system" only considers a script build phase up to date if it has run before, even if outputs are newer than inputs. Use a deterministic object id for script build phases associated with custom commands so that they do not need to re-run after CMake re-generates the project. Fixes: #21669
| * cmGlobalXCodeGenerator: Add infrastructure for deterministic object idsBrad King2021-01-061-13/+23
| |
| * cmGlobalXCodeGenerator: Adopt pbxproj object id generationBrad King2021-01-061-2/+22
| |
* | Xcode: Generalize inheritance of project-level search pathsBrad King2020-12-221-10/+35
| | | | | | | | | | | | | | | | | | Generalize the change from commit bffb17be3d (Xcode: Inherit target library and framework search paths from project, 2020-11-04, v3.19.0-rc3~4^2) to apply to framework and other kinds of search paths added either for include directories or for linking. Issue: #21617
* | cmGlobalXCodeGenerator: Factor out helper to append attributeBrad King2020-12-211-28/+35
| |
* | cmGeneratorTarget: Make GetConfigCommonSourceFiles Xcode-specificBrad King2020-12-161-4/+4
| | | | | | | | | | | | The Xcode generator is the only place left that we do not support per-config sources. Make the corresponding helper Xcode-specific to avoid any other new uses.
* | Allow empty source file list for iOS Sticker packsAndrew Shaitorov2020-12-061-0/+8
| |
* | Compile with explicit language flag when source LANGUAGE property is setBrad King2020-12-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was originally made by commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2), but it was reverted by commit 30aa715fac (Revert "specify language flag when source LANGUAGE property is set", 2020-11-19) to restore compatibility with pre-3.19 behavior. Implement the change again, but add policy CMP0119 to make this change while preserving compatibility with existing projects. Note that the `Compiler/{Clang,Intel,MSVC}-CXX` modules do not need to specify `-TP` for their MSVC-like variants because we already use the flag in `CMAKE_CXX_COMPILE_OBJECT`. Similarly for `Compiler/XL-CXX` and `Platform/Windows-Embarcadero`. Note also that this does not seem possible to implement for XL C. Even with `-qsourcetype=c`, `xlc` complains about an unknown suffix: `1501-218 (W) file /.../AltExtC.zzz contains an incorrect file suffix`. It returns non-zero even with `-qsuppress=1501-218`. Co-Author: Robert Maynard <robert.maynard@kitware.com> Fixes: #14516, #20716
* | Xcode: add support for embedding frameworksGusts Kaksis2020-11-281-1/+133
| | | | | | | | | | | | This commit also prepares for embedding things other than frameworks. In the future, we may want to embed resources and other types supported by Xcode, so the target properties have been documented in a way that clearly signals the future intent.
* | Merge topic 'xcode-cc-work-dir'Brad King2020-11-241-3/+11
|\ \ | |/ | | | | | | | | | | 36921d2d23 Xcode: Fix custom command work-dir placeholders in "new build system" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5527
| * Xcode: Fix custom command work-dir placeholders in "new build system"Brad King2020-11-231-3/+11
| | | | | | | | | | | | | | | | The placeholders for `CONFIGURATION` and `EFFECTIVE_PLATFORM_NAME` need to be handled in the `WORKING_DIRECTORY` of custom commands just as we already do for the `COMMAND`. Fixes: #21483
* | Merge topic 'revert-explicit-LANGUAGE-flag'Brad King2020-11-201-8/+0
|\ \ | |/ | | | | | | | | | | 30aa715fac Revert "specify language flag when source LANGUAGE property is set" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5519
| * Revert "specify language flag when source LANGUAGE property is set"Brad King2020-11-191-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2) and the lookup tables from its two immediate ancestors. The purpose of that change was to convert an explicit `LANGUAGE` source file property into an explicit language specification compiler flag like `-x c`. This seems reasonable since the property is documented as meaning "indicate what programming language the source file is". It is also needed to help compilers deal with non-standard source file extensions they don't recognize. However, some projects have been setting `LANGUAGE C` on `.S` assembler source files to mean "use the C compiler". Passing `-x c` for them breaks the build because the `.S` sources are not written in C. These projects should be updated to use `enable_language(ASM)`, for which CMake often chooses the C compiler as the assembler when using toolchains that support it (which would have to be the case for projects using the approach). Revert the change for now to preserve the old behavior for such projects. We can re-introduce it with a policy in a future version of CMake. Fixes: #21469 Issue: #14516, #20716
* | Merge topic 'xcode-clean-lib-paths'Craig Scott2020-11-161-10/+20
|\ \ | |/ | | | | | | | | | | b1ef2fffe7 Xcode: Clean library paths to avoid linker duplicate symbol definitions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5511
| * Xcode: Clean library paths to avoid linker duplicate symbol definitionsGusts Kaksis2020-11-151-10/+20
| |
* | Merge topic 'xcode-inherit-paths'Brad King2020-11-061-0/+4
|\ \ | |/ | | | | | | | | | | bffb17be3d Xcode: Inherit target library and framework search paths from project Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5463
| * Xcode: Inherit target library and framework search paths from projectGusts Kaksis2020-11-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xcode has multiple levels of build settings with priority in descending order: 1. Target 2. Project 3. Workspace 4. SDK defaults `CMAKE_XCODE_ATTRIBUTE_*` path variables add these to project level, but linked frameworks and libraries override this in target level. Add the `$(inherited)` macro to keep both in the final list. Fixes: #21387
* | Merge topic 'xcode_build_jobs'Brad King2020-10-281-6/+5
|\ \ | |/ |/| | | | | | | | | e794509faa XCode: Use -j build option when job capacity is specified by user Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5429
| * XCode: Use -j build option when job capacity is specified by userFred Baksik2020-10-261-6/+5
| | | | | | | | Fixes: #18304
* | Xcode: Fix regression that automatically links libraries in source listGusts Kaksis2020-10-271-2/+3
|/ | | | | | | | | | | In commit e637744c51 (Xcode: Use "Link Binary With Libraries" to link any library, 2019-07-10, v3.19.0-rc1~494^2~1) we accidentally added all the library type files to "Link Binary With Libraries" build phase if they were passed in as source files. Revert that change as any actually linked libraries will be added to that build phase later in the `AddDependAndLinkInformation` call. Fixes: #21361
* Refactor: Add allowArch parameter to cmake::CreateGlobalGenerator()Kyle Edwards2020-10-051-1/+2
|
* Xcode: Don't add framework as -framework argument in linker info listGusts Kaksis2020-10-021-1/+9
|
* Merge topic 'macos-arm64'Brad King2020-10-011-0/+4
|\ | | | | | | | | | | | | | | | | b6c60f14b6 macOS: Default to arm64 architecture on Apple Silicon hosts 383e81aa60 Tests: Teach RunCMake to ignore Xcode internal objc warnings 8f75912176 Tests: Enable Assembler test case when CMAKE_OSX_ARCHITECTURES has one value Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5291
| * macOS: Default to arm64 architecture on Apple Silicon hostsBrad King2020-09-301-0/+4
| | | | | | | | | | | | | | | | Detect `arm64` hardware using a method that pierces Rosetta. If `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use `arm64` instead of letting the toolchain pick. Fixes: #20989
* | cmake::GetCacheDefinition: Return cmPropvvs314152020-09-281-3/+2
|/
* Xcode: Remove dependency Makefile hacks under the "new build system"Brad King2020-09-241-11/+17
| | | | | | | The original Xcode build system did not properly re-link targets that consumed object libraies. We worked around that with a post-build command on the object libraries themselves that removed their consumers if out of date. The "new build system" does not appear to need such help, so drop the workaround.
* Xcode: Remove remnants of ancient XCODE_DEPEND_HELPER utility targetBrad King2020-09-241-5/+4
| | | | | | The target has not been generated since commit d92d51429e (BUG: fix for bug 6193, fix xcode depend helper, 2008-01-10, v2.6.0~553). Remove it from the list of special targets.
* Xcode: Switch to the "new build system" for Xcode 12 and aboveBrad King2020-09-181-27/+302
| | | | | | | Provide an option to switch back to the original build system via `-T buildsystem=1`. Fixes: #18088
* Xcode: Add option to specify build system variantBrad King2020-09-181-12/+103
| | | | | | Extend the `-T <toolset>` option to support a `buildsystem=` field with the Xcode generator. Add a `CMAKE_XCODE_BUILD_SYSTEM` variable to inform project code about the selected build system variant.
* Xcode: Factor out build phase variable declarationsBrad King2020-09-181-7/+12
|
* Xcode: Clarify name of legacy run script build phase helperBrad King2020-09-181-5/+5
|
* cmGlobalGenerator: Compute a global target ordering respecting dependenciesBrad King2020-09-041-39/+2
| | | | | Move this up from `cmGlobalXCodeGenerator`. It will be useful for all generators.
* Merge topic 'getdef'Brad King2020-09-031-14/+13
|\ | | | | | | | | | | | | 11425041f0 cmMakefile::GetDefinition: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5179
| * cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-14/+13
| |
* | Xcode: Avoid unnecessary duplication of custom commands across targetsBrad King2020-09-011-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not attach a custom command to a target if it is already attached to one of the target's dependencies. The command's output will be available by the time the target needs it because the dependency containing the command will have already been built. Since commit fb45559e09 (Xcode: Process targets in depth-first order during generation, 2018-07-19, v3.13.0-rc1~293^2) we generate a target only after generating its dependencies. Therefore when visiting the custom commands in a target, we can assume that custom commands in its dependencies have already been visited.
* | Xcode: Refactor custom command dependency expansionBrad King2020-09-011-6/+11
|/ | | | Compute and store the "real" dependencies earlier.
* Xcode: Use "Link Binary With Libraries" build phase in some casesGusts Kaksis2020-08-311-68/+216
| | | | | | | OBJECT and STATIC libraries (framework or non-framework) do not use this build phase. Not all items to be linked use this build phase either. Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* Xcode: Add special case for file type extension map for .xcassetsGusts Kaksis2020-08-281-0/+3
|
* Xcode: Refactor build setting append code and attribute getter namingGusts Kaksis2020-08-281-47/+68
| | | | Support both STRING and OBJECT_LIST types in build setting attributes and make it possible to mix them
* Add INTERFACE libraries to generated buildsystem if they have SOURCESBrad King2020-08-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | INTERFACE libraries were created with the intention of collecting usage requirements for use by other targets via `target_link_libraries`. Therefore they were not allowed to have SOURCES and were not included in the generated buildsystem. In practice, this has become limiting: * Header-only libraries do have sources, they just do not compile. Developers should be able to edit those sources (the header files) in their IDE. * Header-only libraries may need to generate some of their header files via custom commands. Some projects work around these limitations by pairing each interface library with an `add_custom_target` that makes the header files and custom commands appear in the generated buildsystem and in IDEs. Lift such limitations by allowing INTERFACE libraries to have SOURCES. For those with sources, add a corresponding build target to the generated buildsystem. Fixes: #19145
* Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-2/+2
|
* Merge topic 'cleanup-target-types'Brad King2020-07-281-11/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ef796cc743 cmGeneratorTarget: Skip computing link implementation for custom targets 45158b2afe cmGeneratorTarget: Simplify logic in ComputeLinkInterfaceLibraries d6b1f5704e cmGeneratorTarget: Add missing nullptr checks 7695b67500 cmComputeTargetDepends: Add missing nullptr check 95b5df8646 cmGeneratorTarget: Skip computing languages for custom targets 2f0790df50 Factor out generator checks for filtering on non-compiling targets 422d9a0ab2 Factor out generator checks for filtering out interface libraries bce82df0aa cmGeneratorTarget: Remove unnecessary target type check in dependency tracing ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !5038
| * Factor out generator checks for filtering out interface librariesBrad King2020-07-231-11/+7
| | | | | | | | | | | | Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell generators whether a target should participate in the generated build system.