1

is it possible to set a compiler flag in Xcode to not compile any source code which is flagged not into the archive (ipa)?!

Maybe just like an if-statement?!

if (shouldBeInAppPackage)
{
    //Code in here should be compiled in App Package
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
davidOhara
  • 1,008
  • 5
  • 17
  • 39

1 Answers1

1

You can use a pre-processor macro for that. In the pre-compiled header, or some other header file which is imported into the source files you want to use this on, you can define:

#define INCLUDE_IN_BUILD 0

and then wrap code with:

#if INCLUDE_IN_BUILD
    code();
    code();
#endif

You can then selectively include/exlude that code by changing the 0 to 1.

Think of a better name than INCLUDE_IN_BUILD, however.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242