macOS: Support Xcode Archiving for distributing application bundles

This is a port of iOS commit f3f8647 to main, for Xcode archiving to
also work for macOS bundles, allowing the bundle to be archived and
later distributed via Testflight, App Store Connect, etc...

Additonal Xcode property also had to be added to the extern draco shared
library target to prevent it from being included in the Xcode archive
(an implicit behavior for `SHARED` CMake libraries), without this,
the archive would get polluted, preventing it from being properly
recognized as a proper app bundle archive.

Pull Request: https://projects.blender.org/blender/blender/pulls/146027
This commit is contained in:
Jonas Holzman
2025-09-23 20:56:18 +02:00
parent eb32994b50
commit c08d42aebf
2 changed files with 16 additions and 0 deletions

View File

@@ -29,3 +29,13 @@ target_include_directories(extern_draco PUBLIC "${INC}")
target_link_libraries(extern_draco PUBLIC "${LIB}")
blender_source_group(extern_draco "${SRC}")
if (APPLE)
# On macOS, prevent the draco library (already present in the application bundle) from being wrongly copied into the
# Xcode archive used for application distribution, which pollutes the archive and prevents it from being properly
# recognized. This effectively corrects a bad implicit CMake behavior for `SHARED` library targets on Xcode.
set_target_properties(extern_draco PROPERTIES
XCODE_ATTRIBUTE_SKIP_INSTALL "YES"
XCODE_ATTRIBUTE_INSTALL_PATH ""
)
endif()

View File

@@ -1614,6 +1614,12 @@ elseif(APPLE)
MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION}.${BLENDER_VERSION_PATCH} ${BLENDER_DATE}"
)
# Xcode Archiving support for distributing the application (Testflight, App Store Connect, etc...)
set_target_properties(blender PROPERTIES
XCODE_ATTRIBUTE_SKIP_INSTALL "NO"
XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
)
if(WITH_BLENDER_THUMBNAILER)
set(OSX_THUMBNAILER_SOURCEDIR ${OSX_APP_SOURCEDIR}/Contents/PlugIns/blender-thumbnailer.appex)
set_target_properties(blender-thumbnailer PROPERTIES