Skip to content

Commit d306c27

Browse files
0x1b2cclaude
andcommitted
Force release builds to be universal so Intel Macs can run them
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8cbde11 commit d306c27

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ BUILD_DIR = $(CURDIR)/build
77
# Serialize agent-triggered Xcode builds through one shared DerivedData cache.
88
XCODEBUILD_LOCK = $(BUILD_DIR)/.xcodebuild.lock
99
XCODEBUILD = tools/with_xcodebuild_lock.sh $(XCODEBUILD_LOCK) xcodebuild
10+
# 强制 universal binary:不指定 destination 时 xcodebuild 会从 {arm64, x86_64, Any Mac}
11+
# 中挑第一条(host arch),其 arch 字段反过来覆盖 ARCHS,把 build 约束成单一架构。
12+
# generic/platform=macOS 是「不绑定具体架构」的 destination,不会触发这种 override,
13+
# ARCHS 按项目自身配置生效(macOS SDK 的 ARCHS_STANDARD 恰好同时包含 arm64 与 x86_64)。
14+
#
15+
# 仅在 release target 启用(用于分发/跨架构部署测试)。日常 build / make install
16+
# 不带此 flag,保持 host-arch only 的快速迭代体验。
17+
XCDEST = -destination 'generic/platform=macOS'
1018
APP_NAME = Linguist Zixia Input.app
1119
INSTALL_DIR = $(HOME)/Library/Input Methods
1220
QUIET_FLAG = $(if $(V),,-quiet)
@@ -81,7 +89,7 @@ dict-release: ## 重新生成 production zh_dict
8189

8290
release: $(DICT_DB) unbundle-alt-dicts ## 构建 Release 并注入 MARKETING_VERSION
8391
$(XCODEBUILD) -project $(PROJECT) -scheme $(SCHEME) -configuration Release \
84-
-derivedDataPath $(BUILD_DIR) $(QUIET_FLAG) $(XCFLAGS) \
92+
$(XCDEST) -derivedDataPath $(BUILD_DIR) $(QUIET_FLAG) $(XCFLAGS) \
8593
MARKETING_VERSION=$(VERSION_NUMBER) \
8694
build
8795

0 commit comments

Comments
 (0)