If Apple Generic Versioning support is enabled, Xcode automatically generates the MyFramework_vers.c file in DERIVED_SOURCES_DIR , which contains the version string and number, defined as const unsigned char[] and const double .
However, if -Wmissing-variable-declarations enabled (the -Weverything part), this triggers warnings
no previous extern declaration for non-static variable 'MyFrameworkVersionString'
no previous extern declaration for non-static variable "MyFrameworkVersionNumber"
Possible solutions seem to be:
- add
-Wno-missing-variable-declarations to cflags for this file - add
extern declarations over variable definitions - add
#import , which pulls extern declarations from the umbrella header
But I cannot figure out how to do this, since the file is in DerivedSources and is not part of the compilation sources phase. What am I missing?
(I found the VERSION_INFO_EXPORT_DECL parameter that would allow me to flag extern variables, but then I get the warning "extern variable has an initialization warning", starting with -Wextern-initializer , so this does not help).
source share