2

I want to set the Debug flag in Compile Sources. But I'm not sure what the right way is. I don't want to compile some files when I'm building for release.

Other Swift Flags screenShot:

Other Swift Flags screenShot

Compile Sources screenShot:

Compile Sources screenShot

Jack Lawrence
  • 10,664
  • 1
  • 47
  • 61
Den Jo
  • 413
  • 4
  • 10

1 Answers1

0

You need to set "Other Swift Flags" in your target's Build Settings to -D DEBUG so you can use the "#if/#else/#endif" preprocessor macros.

colinrf
  • 253
  • 1
  • 6
  • I know, but I don't want to compile whole things when I'm building for release. For example, the TinyColsoneCotroller.swift file will not be compiled when building release – Den Jo Mar 21 '17 at 00:08
  • I can also wrap the TinyConsoleController using the #if DEBUG #endif. But I think it's not clear. I want to divide files by Compiler Flags if I can – Den Jo Mar 21 '17 at 00:15