更改其他Swift标志会产生构建错误

时间:2018-02-16 07:21:39

标签: ios swift build cocoapods

我正在为开发,测试,制作,QA等创建多个目标。当我这样做时,我想通过更改"其他快速标记来区分这些目标"。默认情况下,它显示在下面的屏幕截图中。

Screenshot

我想改变那个" -D"到" Prod"。我想因为我使用Cocoapods,我得到了构建错误。我的Pods xcconfig文件位于下方;

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Alamofire"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

我低于错误

  

:0:错误:未知参数:' -PROD'   命令/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc失败,退出代码为1

1 个答案:

答案 0 :(得分:0)

添加处理器宏时,必须使用前缀-D定义它们,因此,需要像这样添加-DPROD

Xcode configuration for Macro