title: Objective-C: How to define a macro to disable a piece of source code from pod dependency?
body: <p>I have a private dependent pod project which is built by us via cocoapods, now I want to use a macro, e.g. ADHOC, to disable some source codes in pod project like this,</p>
  
  <pre><code>#if ADHOC
      // for ad hoc build.
  #else 
      // for app store build.
  #endif
  </code></pre>
  
  <p>There are two high-level projects which rely on the pod project and they have different requirements, one for ad-hoc build (projectA), another for app store build (projectB).</p>
  
  <p>After building the dependence relationship in their Podfile, I tried to define ADHOC macro in projectA before importing the entry header file, it just won't build the source code within ADHOC statement, even if importing the entry header file in main project's prefix header file.</p>
  
  <p>I know the MAS_SHORTHAND macro usage in <a href="https://github.com/SnapKit/Masonry" rel="nofollow noreferrer">Masonry</a>, it defines two pieces of implementation of those methods, when compiling to the main project, it pre-compiles the shortcut method to full version.</p>
  
  <p>For my case, I expect the macro definition from the main project could affect the pod project. It seems something ridiculous, I know the compile order of the module. It may be impossible to focus on main project only, so I guess the cocoapods may make it works, to inject the macro to pod project before compiling it.</p>
  
  <p>If there are some configuration values for Podfile (not the .podspec) file, please let me know, thanks!</p>