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
  • 298,130
  • 40
  • 468
  • 517
davidOhara
  • 978
  • 4
  • 16
  • 38

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
  • 116,099
  • 18
  • 197
  • 233