1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

249 Commits

Author SHA1 Message Date
Ben Boeckel
84372ce0b5 prop_sf/OBJECT_NAME: no-op for the FASTBuild and Xcode generators
There's no control over the object base name implemented in the
FASTBuild generator. Rather than expecting some half-supported behavior,
just ignore it completely there.

Similarly, Xcode ends up making its own object paths internally
regardless of what CMake would like.
2025-09-09 09:58:07 -04:00
Daniel Pfeifer
ee1c32b6d7 source: Pass cmBuildOptions by value 2025-07-30 11:55:34 -04:00
Brad King
b59925a842 Merge topic 'xcode-build-workspace'
844d79916a cmake --build: Add support for driving Xcode workspaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10855
2025-06-11 10:26:54 -04:00
Stepanov Igor
844d79916a cmake --build: Add support for driving Xcode workspaces
External tools may create a `.xcworkspace` directory next to the
`.xcodeproj` directory that CMake generates.  If a workspace exists,
drive the build through it instead.

Closes: #26958
Co-authored-by: Brad King <brad.king@kitware.com>
2025-06-10 11:08:04 -04:00
Brad King
a2414480e8 cmGlobalXCodeGenerator: Remove unused argument from LookupFlags helper 2025-06-07 06:43:08 -04:00
Brad King
5fdd4a5859 cmGlobalXCodeGenerator: Convert GetTargetProductType signature to string_view 2025-06-07 06:42:56 -04:00
Brad King
ced6b31c48 cmGlobalXCodeGenerator: Convert CreateString signature to string_view 2025-06-07 06:36:49 -04:00
Brad King
93cbcd7596 Merge topic 'xcode-debugger-workdir'
149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
0f1b9ef32a Help: VS_DEBUGGER_WORKING_DIRECTORY precedence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10736
2025-05-05 08:52:54 -04:00
Craig Scott
149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
This also means when XCODE_SCHEME_WORKING_DIRECTORY is
set and a Xcode generator is used, that property will be used when
writing the debugger field in the file API replies.

Fixes: #26909
2025-05-03 10:16:15 -04:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Alexandra Cherdantseva
2dc8c1d45f Xcode: Fix POST_BUILD order in bundle targets on Xcode 16+
XCode 16+ no longer delays our POST_BUILD phase until after bundle files
like `Info.plist` are generated.  Teach the Xcode generator to add
explicit dependencies to the POST_BUILD phase in bundle targets to
ensure the files are created before it runs.

Fixes: #26656
2025-02-25 08:15:12 -05:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Aleksei Sapitskii
0282429c5a Xcode: Fix XCODE_EMBED_FRAMEWORKS when settings differ across targets
In commit 5651901c54 (Xcode: add support for embedding frameworks,
2020-10-24, v3.20.0-rc1~402^2) we incorrectly reused `PBXBuildFile`
instances when the same framework is embedded in multiple targets,
causing target-specific settings to conflict.

Fixes: #26438
2024-12-06 09:22:07 -05:00
Marc Chevrier
8bcf9c7a3e Add support of "LINKER:" prefix for artifact creation flags
The following variables now support the LINKER: prefix:
    * CMAKE_SHARED_LIBRARY_CREATE_<LANG>_FLAGS
    * CMAKE_SHARED_MODULE_CREATE_<LANG>_FLAGS
    * CMAKE_<LANG>_LINK_FLAGS
2024-11-04 17:08:03 +01:00
Brad King
d61fc2c52e cmGlobalXCodeGenerator: Migrate legacy makefile path escaping to local helper
Also clarify the name.  It does not do any relative path conversion.
2024-05-15 11:40:31 -04:00
lapfelix
1fa2ec1bbd Xcode: Use deterministic object ids for targets
When a CMake-generated Xcode project is included in another Xcode project,
the used targets' object ids are kept as `remoteGlobalIDString`.
Make the ids deterministic and somewhat independent of the build
tree location.
2024-04-10 14:33:57 -04:00
Jonathan Earnshaw
2b4bb43ed3 Xcode: Add support to embed XPC Services 2023-11-30 10:09:34 +13: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
e98088ef75 clang-tidy: fix modernize-use-override lints 2023-07-30 18:33:07 -04: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
Brad King
024e3d2bf6 Xcode: Put object files in a place that Xcode cleans
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
2022-10-28 15:38:07 -04:00
Brad King
dc5fc898f6 Xcode: Set object file locations using TARGET_TEMP_DIR
This avoids relying on `SYMROOT` to locate the object files.

Issue: #22550
2022-09-29 15:04:07 -04:00
Hyper Nova Sun
41ba35a42b cmTarget: Add HasKnownObjectFileLocation() shorthand
Allow `cmGlobalGenerator`s to decide `HasKnownObjectFileLocation()` per given
`cmTarget`

- `cmGlobalGenerator::HasKnownObjectFileLocation()` now takes an optional `cmGeneratorTarget`
- `cmTarget::HasKnownObjectFileLocation()` added as a shorthand
2022-04-11 14:10:29 -07:00
Gregor Jasny
53ca6edd8a xcode: add support for xcconfig files
Fixes: #18420
2022-04-03 22:39:34 +02:00
Marc Chevrier
40178f3c90 cmGlobalGenerator: Add helper to split framework path
cmComputeLinkInformation and cmGlobalXCodeGenerator now rely on
this method to handle framework paths.
2022-02-13 15:39:14 +01:00
Carsten Rudolph
193b8fca52 cmBuildOptions: Split build arguments into separate object. 2022-01-22 06:35:38 -05:00
NAKAMURA Takumi
67c75064d1 Source: Fix IWYU warnings in Xcode generators 2021-11-16 21:06:13 +09:00
Gusts Kaksis
9e1e7dc7db Xcode: Add embedded plugins option 2021-11-10 09:57:07 -05:00
Brad King
46e9ff5729 Restore honoring CMAKE_GENERATOR_INSTANCE in toolchain file
Revert the changes from commit d5b5c19278 (cmGlobalGenerator:
FindMakeProgram() before CMakeDetermineSystem, 2020-06-15,
v3.19.0-rc1~619^2~3) and commit ef91fb02f3 (cmGlobalGenerator:
FindMakeProgram() at a generator-specific time, 2020-11-23,
v3.19.1~2^2).  We must delay selecting the location of MSBuild until
after an instance of Visual Studio has been selected.

It is now safe to revert the ordering because the motivating use
case (sysroot detection in Platform/Android-Determine) has been
implemented another way.

Fixes: #22782
2021-10-20 13:00:26 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
dffa3f485c cmGlobalGenerator::PrintCompilerAdvice: use cmProp as augment 2021-09-19 19:11:07 +02:00
Brad King
f69079577a cmGlobalXCodeGenerator: Simplify relative path conversion under project root 2021-05-12 15:43:58 -04:00
Brad King
395e1d458e Merge topic 'xcode_app_extensions'
eb5e33ba47 Xcode: Add support for embedding app extensions
f62a2bf44f Tests: Factor out XcodeProject-Embed check function findAttribute()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5934
2021-04-26 11:34:38 -04:00
Alexander Akhundzhanov
eb5e33ba47 Xcode: Add support for embedding app extensions
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-04-22 15:17:02 +10:00
Marc Chevrier
253aff6c94 Xcode: Add support of DEPFILE for add_custom_command, part 2
This MR extend the support of 'DEPFILE' to buildsystem version 1.

Issue: #20286
2021-04-17 11:05:26 +02:00
Marc Chevrier
d67cc4882d Xcode: Add support of DEPFILE for add_custom_command
Issue: #20286
2021-04-15 12:17:31 -04:00
Brad King
38335f275f Merge topic 'xcode-object-ids'
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
2021-01-08 09:07:18 -05:00
Brad King
b8b6573db8 Xcode: Use deterministic object ids for script build phases
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
2021-01-06 18:46:30 -05:00
Brad King
2892228dc9 cmGlobalXCodeGenerator: Add infrastructure for deterministic object ids 2021-01-06 16:24:12 -05:00
Brad King
d250b67722 cmGlobalXCodeGenerator: Adopt pbxproj object id generation 2021-01-06 16:21:53 -05:00
Brad King
5115e8b2b6 Xcode: Generalize inheritance of project-level search paths
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
2020-12-22 08:56:26 -05:00
Brad King
6b6230b23b cmGlobalXCodeGenerator: Factor out helper to append attribute 2020-12-21 10:19:45 -05:00
Gusts Kaksis
5651901c54 Xcode: add support for embedding frameworks
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.
2020-11-28 15:36:24 +11:00
Kyle Edwards
ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time
d5b5c192 moved FindMakeProgram() to an earlier time, which resulted
in CMAKE_MAKE_PROGRAM not being read from the toolchain file. Change
it to only call FindMakeProgram() early in the specific cases of
Visual Studio and Xcode, and restore the old behavior for all other
generators.

Fixes: #21486
2020-11-23 14:20:08 -05:00
Brad King
c6c7f6fbeb Xcode: Remove remnants of ancient XCODE_DEPEND_HELPER utility target
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.
2020-09-24 14:53:22 -04:00
Brad King
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
Provide an option to switch back to the original build system via
`-T buildsystem=1`.

Fixes: #18088
2020-09-18 13:02:14 -04:00
Brad King
2db623f554 Xcode: Add option to specify build system variant
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.
2020-09-18 12:49:17 -04:00