外部建構專案
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
外部 Make files 可以與 Xcode 搭配使用
Build System 專案範本。您可以修改這些檔案來充分利用
Xcode 專案設定,例如建構類型和位置
適合單獨使用
建立外部專案
如要建立新的外部建構專案,請在 Xcode 中選取「New」->「New Project...」。
「External Build System」範本。將專案放入
與目標 Makefile 相同的目錄。
新增 Xcode 版本設定
叫用外部建構時,Xcode 會定義其
版本設定。
這些設定會定義建構檔案的建立位置,以及編譯器和
連結器旗標我們使用 Make 的條件指令
修改建構作業,以便在 Xcode 叫用時修改建構作業。
以以下範例來說,您可以設定的變數 (例如 BUILD_DIR) 可以是
您要的任何名稱,而條件式使用環境變數
Xcode 集:
ifdef CONFIGURATION_BUILD_DIR
# In Xcode build
BUILD_DIR = $(CONFIGURATION_BUILD_DIR)/build
ARCHFLAGS = $(ARCHS:%=-arch %)
SDKFLAGS = -isysroot $(SDKROOT)
else
# In command-line build
BUILD_DIR = $(HOME)/build
ARCHFLAGS =
SDKFLAGS =
endif
ifdef OPTIMIZATION_LEVEL
DEBUGFLAGS := $(DEBUGFLAGS) -O$(OPTIMIZATION_LEVEL)
endif
ifdef OTHER_CFLAGS
DEBUGFLAGS := $(DEBUGFLAGS) $(OTHER_CFLAGS)
endif
# Workaround for iPhoneSimulator SDK's gcc bug
ifdef EFFECTIVE_PLATFORM_NAME
ifneq ($(EFFECTIVE_PLATFORM_NAME), -iphonesimulator)
WARNINGS := $(WARNINGS) -Wreturn-type
endif
endif
J2OBJCC_FLAGS = $(WARNINGS) $(SDKFLAGS) $(ARCHFLAGS) $(DEBUGFLAGS)
J2OBJCC = $(J2OBJC_DIST)/j2objcc $(J2OBJCC_FLAGS)
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eXcode can be used with external Make files using the External Build System project template.\u003c/p\u003e\n"],["\u003cp\u003eXcode build settings such as build type and location can be utilized within Make files using conditional directives.\u003c/p\u003e\n"],["\u003cp\u003eMake files can be adapted to function effectively both within Xcode and independently.\u003c/p\u003e\n"],["\u003cp\u003eThis setup allows for greater control and flexibility in building projects using j2objc.\u003c/p\u003e\n"]]],[],null,[]]