title: How to change compilation flags for MyFramework_vers.c in Xcode?
body: <p>With Apple Generic Versioning enabled, Xcode autogenerates a <code>MyFramework_vers.c</code> file in the <code>DERIVED_SOURCES_DIR</code>, which contains the version string and number defined as <code>const unsigned char[]</code> and <code>const double</code>.</p>
  
  <p>However, with <code>-Wmissing-variable-declarations</code> enabled (part of <code>-Weverything</code>), this produces the warnings</p>
  
  <blockquote>
    <p>no previous extern declaration for non-static variable 'MyFrameworkVersionString'<br>
    no previous extern declaration for non-static variable 'MyFrameworkVersionNumber'</p>
  </blockquote>
  
  <p>It seems the possible solutions are:</p>
  
  <ul>
  <li>add <code>-Wno-missing-variable-declarations</code> to the cflags for this file</li>
  <li>add <code>extern</code> declarations above the variable definitions</li>
  <li>add a <code>#import</code> that pulls in the <code>extern</code> declarations from the umbrella header</li>
  </ul>
  
  <p>But I can't figure out how to do any of these since the file lives in DerivedSources and isn't a member of the Compile Sources phase. What am I missing?</p>
  
  <p>(I found the <code>VERSION_INFO_EXPORT_DECL</code> setting which would allow me to mark the variables <code>extern</code>, but then I get the "extern variable has an initializer" warning, from <code>-Wextern-initializer</code>, so that doesn't help.)</p>