Xcode工程屬性列表
每一個Xcode工程屬性都有一個對應的屬性ID稚瘾,在蘋果官網幫助文檔可以查到:
https://help.apple.com/xcode/mac/current/#/itcaec37c2a6
下面是關于strip的配置屬性
<pre>
Strip Debug Symbols During Copy (COPY_PHASE_STRIP)
Specifies whether binary files that are copied during the build, such as in a Copy Bundle Resources or Copy Files build phase, should be stripped of debugging symbols. It does not cause the linked product of a target to be stripped—use Strip Linked Product (STRIP_INSTALLED_PRODUCT) for that.
CoreML Model Class Generation Language (COREML_CODEGEN_LANGUAGE)
The Source-code language to use for generated CoreML model class. By default "Automatic" will analyze your project to determine the correct language. Adjust this setting to explicitly select "Swift" or "Objective-C", or select "None" to disable model class generation.
CoreML Generated Model Inherits NSObject (COREML_CODEGEN_SWIFT_GLOBAL_MODULE)
</pre>
通過CMake配置Xcode屬性
只需要在每個Xcode屬性ID前面加上 CMAKE_XCODE_ATTRIBUTE_ 即可贸弥。
比如要編譯的release庫包含調試信息,則需要將工程配置中的strip設置改為No,則在生成XCode工程的命令行中進行如下配置:
cmake -DCMAKE_XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT=NO -DCMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP=NO -DCMAKE_BUILD_TYPE=Release -G Xcode ../