Swift添加Preprocessor Macros
来源:互联网 发布:深圳软件基地 编辑:程序博客网 时间:2024/04/28 10:02
Swift的build configuration很强大,不同的配置项可以配置不同的编译环境,当然也就可以配置不同的预编译宏
流程很简单,在Preprocessor Macros中添加一个宏,比如DEBUG,那么可以设置不同选项中的值,比如Debug模式设置为DEBUG=1,Release模式下设置为DEBUG=2,设置完毕之后,还需要在Build Settings-Swift Compiler-Custom Flags-Other Swift Flags中加上 -D DEBUG,这样在代码中就能使用DEBUG这个全局变量了
这样设置当然是很方便的,但是我在使用中发现了一个问题,单个的宏设置是OK的,但是设置多个就无法生效?
比如我再设置一个TYPE宏,Debug模式中设置为TYPE=1,Release中设置为TYPE=2,但是Other Swift Flags中无论怎么添加,都无法编译成功,网上搜了很久都没有找到答案,解决了此问题的童鞋麻烦再下面评论下解决方案,多谢~
0 0
- Swift添加Preprocessor Macros
- Preprocessor Macros添加无效
- Predefined shader preprocessor macros
- Using Microsoft-Specific Predefined Preprocessor Macros
- Using ANSI-Compliant Predefined Preprocessor Macros
- Xcode定义Preprocessor Macros,编译宏。
- Xcode定义Preprocessor Macros,编译宏。
- PReprocessor Macros : 全局宏命令的应用
- Xcode定义Preprocessor Macros编译宏
- iOS 利用Preprocessor Macros预定义宏Debug
- iOS用全局宏的概念 preprocessor macros
- How do I define preprocessor macros in the xcode project settings
- iOS用全局宏的概念理解xcode中的设置 preprocessor macros
- Predefined Shader preprocessor macros //预定义的着色器预处理宏
- 【GCC英文手册翻译】预处理器的系统特定预定义宏(The C preprocessor:System-specific Predefined Macros)
- Preprocessor Directives
- C preprocessor
- C preprocessor
- IOS本地地图使用
- DFS专练
- 排序——冒泡排序及其改进版本
- 华为机试题:【中级】报文转换
- ios开发中的Swift面向对象
- Swift添加Preprocessor Macros
- 十道海量数据处理面试题与十个方法大总结
- Android 使用Picasso加载网络图片等比例缩放
- Cookies和广告推广_20160209
- 软件性能测试概述(1)
- HDU【1495】非常可乐
- 焚香
- Error:executing aidl:return code 1
- WRANGLING DALVIK: MEMORY MANAGEMENT IN ANDROID