The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1142 lines
48KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-10 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCER_PROJECTEXPORT_XCODE_JUCEHEADER__
  19. #define __JUCER_PROJECTEXPORT_XCODE_JUCEHEADER__
  20. #include "jucer_ProjectExporter.h"
  21. //==============================================================================
  22. class XCodeProjectExporter : public ProjectExporter
  23. {
  24. public:
  25. //==============================================================================
  26. static const char* getNameMac() { return "XCode (MacOSX)"; }
  27. static const char* getNameiOS() { return "XCode (iOS)"; }
  28. static const char* getValueTreeTypeName (bool iPhone) { return iPhone ? "XCODE_IPHONE" : "XCODE_MAC"; }
  29. //==============================================================================
  30. XCodeProjectExporter (Project& project_, const ValueTree& settings_, const bool iPhone_)
  31. : ProjectExporter (project_, settings_),
  32. iPhone (iPhone_)
  33. {
  34. name = iPhone ? getNameiOS() : getNameMac();
  35. projectIDSalt = hashCode64 (project.getProjectUID());
  36. if (getTargetLocation().toString().isEmpty())
  37. getTargetLocation() = getDefaultBuildsRootFolder() + (iPhone ? "iOS" : "MacOSX");
  38. if (getVSTFolder().toString().isEmpty())
  39. getVSTFolder() = "~/SDKs/vstsdk2.4";
  40. if (getRTASFolder().toString().isEmpty())
  41. getRTASFolder() = "~/SDKs/PT_80_SDK";
  42. if (getSettings() ["objCExtraSuffix"].isVoid())
  43. getObjCSuffix() = createAlphaNumericUID();
  44. }
  45. static XCodeProjectExporter* createForSettings (Project& project, const ValueTree& settings)
  46. {
  47. if (settings.hasType (getValueTreeTypeName (false)))
  48. return new XCodeProjectExporter (project, settings, false);
  49. else if (settings.hasType (getValueTreeTypeName (true)))
  50. return new XCodeProjectExporter (project, settings, true);
  51. return 0;
  52. }
  53. //==============================================================================
  54. Value getObjCSuffix() { return getSetting ("objCExtraSuffix"); }
  55. int getLaunchPreferenceOrderForCurrentOS()
  56. {
  57. #if JUCE_MAC
  58. return iPhone ? 1 : 2;
  59. #else
  60. return 0;
  61. #endif
  62. }
  63. bool isAvailableOnCurrentOS()
  64. {
  65. #if JUCE_MAC
  66. return true;
  67. #else
  68. return false;
  69. #endif
  70. }
  71. bool isPossibleForCurrentProject() { return project.getProjectType().isGUIApplication() || ! iPhone; }
  72. bool usesMMFiles() const { return true; }
  73. bool isXcode() const { return true; }
  74. void createPropertyEditors (Array <PropertyComponent*>& props)
  75. {
  76. ProjectExporter::createPropertyEditors (props);
  77. props.add (new TextPropertyComponent (getObjCSuffix(), "Objective-C class name suffix", 64, false));
  78. props.getLast()->setTooltip ("Because objective-C linkage is done by string-matching, you can get horrible linkage mix-ups when different modules containing the "
  79. "same class-names are loaded simultaneously. This setting lets you provide a unique string that will be used in naming the obj-C classes in your executable to avoid this.");
  80. if (project.getProjectType().isGUIApplication() && ! iPhone)
  81. {
  82. props.add (new TextPropertyComponent (getSetting ("documentExtensions"), "Document file extensions", 128, false));
  83. props.getLast()->setTooltip ("A comma-separated list of file extensions for documents that your app can open.");
  84. }
  85. else if (iPhone)
  86. {
  87. props.add (new BooleanPropertyComponent (getSetting ("UIFileSharingEnabled"), "File Sharing Enabled", "Enabled"));
  88. props.getLast()->setTooltip ("Enable this to expose your app's files to iTunes.");
  89. props.add (new BooleanPropertyComponent (getSetting ("UIStatusBarHidden"), "Status Bar Hidden", "Enabled"));
  90. props.getLast()->setTooltip ("Enable this to disable the status bar in your app.");
  91. }
  92. }
  93. void launchProject()
  94. {
  95. getProjectBundle().startAsProcess();
  96. }
  97. //==============================================================================
  98. void create()
  99. {
  100. infoPlistFile = getTargetFolder().getChildFile ("Info.plist");
  101. createIconFile();
  102. File projectBundle (getProjectBundle());
  103. createDirectoryOrThrow (projectBundle);
  104. createObjects();
  105. File projectFile (projectBundle.getChildFile ("project.pbxproj"));
  106. {
  107. MemoryOutputStream mo;
  108. writeProjectFile (mo);
  109. overwriteFileIfDifferentOrThrow (projectFile, mo);
  110. }
  111. writeInfoPlistFile();
  112. }
  113. private:
  114. OwnedArray<ValueTree> pbxBuildFiles, pbxFileReferences, groups, misc, projectConfigs, targetConfigs;
  115. StringArray buildPhaseIDs, resourceIDs, sourceIDs, frameworkIDs;
  116. StringArray frameworkFileIDs, rezFileIDs, resourceFileRefs;
  117. File infoPlistFile, iconFile;
  118. int64 projectIDSalt;
  119. const bool iPhone;
  120. static String sanitisePath (const String& path)
  121. {
  122. if (path.startsWithChar ('~'))
  123. return "$(HOME)" + path.substring (1);
  124. return path;
  125. }
  126. File getProjectBundle() const { return getTargetFolder().getChildFile (project.getProjectFilenameRoot()).withFileExtension (".xcodeproj"); }
  127. bool hasPList() const { return ! (project.getProjectType().isLibrary() || project.getProjectType().isCommandLineApp()); }
  128. String getAudioPluginBundleExtension() const { return "component"; }
  129. //==============================================================================
  130. void createObjects()
  131. {
  132. if (! project.getProjectType().isLibrary())
  133. addFrameworks();
  134. const String productName (project.getConfiguration (0).getTargetBinaryName().toString());
  135. if (project.getProjectType().isGUIApplication()) addBuildProduct ("wrapper.application", productName + ".app");
  136. else if (project.getProjectType().isCommandLineApp()) addBuildProduct ("compiled.mach-o.executable", productName);
  137. else if (project.getProjectType().isLibrary()) addBuildProduct ("archive.ar", getLibbedFilename (productName));
  138. else if (project.getProjectType().isAudioPlugin()) addBuildProduct ("wrapper.cfbundle", productName + "." + getAudioPluginBundleExtension());
  139. else if (project.getProjectType().isBrowserPlugin()) addBuildProduct ("wrapper.cfbundle", productName + ".plugin");
  140. else jassert (productName.isEmpty());
  141. if (hasPList())
  142. {
  143. RelativePath plistPath (infoPlistFile, getTargetFolder(), RelativePath::buildTargetFolder);
  144. addFileReference (plistPath);
  145. resourceFileRefs.add (createID (plistPath));
  146. }
  147. if (iconFile.exists())
  148. {
  149. RelativePath iconPath (iconFile, getTargetFolder(), RelativePath::buildTargetFolder);
  150. addFileReference (iconPath);
  151. resourceIDs.add (addBuildFile (iconPath, false, false));
  152. resourceFileRefs.add (createID (iconPath));
  153. }
  154. addProjectItem (project.getMainGroup(), String::empty, false);
  155. for (int i = 0; i < project.getNumConfigurations(); ++i)
  156. {
  157. Project::BuildConfiguration config (project.getConfiguration (i));
  158. addProjectConfig (config.getName().getValue(), getProjectSettings (config));
  159. addTargetConfig (config.getName().getValue(), getTargetSettings (config));
  160. }
  161. addConfigList (projectConfigs, createID ("__projList"));
  162. addConfigList (targetConfigs, createID ("__configList"));
  163. if (! project.getProjectType().isLibrary())
  164. addBuildPhase ("PBXResourcesBuildPhase", resourceIDs);
  165. if (rezFileIDs.size() > 0)
  166. addBuildPhase ("PBXRezBuildPhase", rezFileIDs);
  167. addBuildPhase ("PBXSourcesBuildPhase", sourceIDs);
  168. if (! project.getProjectType().isLibrary())
  169. addBuildPhase ("PBXFrameworksBuildPhase", frameworkIDs);
  170. if (project.getProjectType().isAudioPlugin())
  171. addPluginShellScriptPhase();
  172. addTargetObject();
  173. addProjectObject();
  174. }
  175. static Image fixMacIconImageSize (Image& image)
  176. {
  177. const int w = image.getWidth();
  178. const int h = image.getHeight();
  179. if (w != h || (w != 16 && w != 32 && w != 48 && w != 64))
  180. {
  181. const int newSize = w >= 128 ? 128 : (w >= 64 ? 64 : (w >= 32 ? 32 : 16));
  182. Image newIm (Image::ARGB, newSize, newSize, true);
  183. Graphics g (newIm);
  184. g.drawImageWithin (image, 0, 0, newSize, newSize,
  185. RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize, false);
  186. return newIm;
  187. }
  188. return image;
  189. }
  190. void writeIcnsFile (const Array<Image>& images, OutputStream& out)
  191. {
  192. MemoryOutputStream data;
  193. for (int i = 0; i < images.size(); ++i)
  194. {
  195. Image image (fixMacIconImageSize (images.getReference (i)));
  196. const int w = image.getWidth();
  197. const int h = image.getHeight();
  198. const char* type = nullptr;
  199. const char* maskType = nullptr;
  200. if (w == h)
  201. {
  202. if (w == 16) { type = "is32"; maskType = "s8mk"; }
  203. if (w == 32) { type = "il32"; maskType = "l8mk"; }
  204. if (w == 48) { type = "ih32"; maskType = "h8mk"; }
  205. if (w == 128) { type = "it32"; maskType = "t8mk"; }
  206. }
  207. if (type != nullptr)
  208. {
  209. data.write (type, 4);
  210. data.writeIntBigEndian (8 + 4 * w * h);
  211. const Image::BitmapData bitmap (image, Image::BitmapData::readOnly);
  212. int y;
  213. for (y = 0; y < h; ++y)
  214. {
  215. for (int x = 0; x < w; ++x)
  216. {
  217. const Colour pixel (bitmap.getPixelColour (x, y));
  218. data.writeByte ((char) pixel.getAlpha());
  219. data.writeByte ((char) pixel.getRed());
  220. data.writeByte ((char) pixel.getGreen());
  221. data.writeByte ((char) pixel.getBlue());
  222. }
  223. }
  224. data.write (maskType, 4);
  225. data.writeIntBigEndian (8 + w * h);
  226. for (y = 0; y < h; ++y)
  227. {
  228. for (int x = 0; x < w; ++x)
  229. {
  230. const Colour pixel (bitmap.getPixelColour (x, y));
  231. data.writeByte ((char) pixel.getAlpha());
  232. }
  233. }
  234. }
  235. }
  236. jassert (data.getDataSize() > 0); // no suitable sized images?
  237. out.write ("icns", 4);
  238. out.writeIntBigEndian (data.getDataSize() + 8);
  239. out << data;
  240. }
  241. void createIconFile()
  242. {
  243. Array<Image> images;
  244. Image bigIcon (project.getBigIcon());
  245. if (bigIcon.isValid())
  246. images.add (bigIcon);
  247. Image smallIcon (project.getSmallIcon());
  248. if (smallIcon.isValid())
  249. images.add (smallIcon);
  250. if (images.size() > 0)
  251. {
  252. MemoryOutputStream mo;
  253. writeIcnsFile (images, mo);
  254. iconFile = getTargetFolder().getChildFile ("Icon.icns");
  255. overwriteFileIfDifferentOrThrow (iconFile, mo);
  256. }
  257. }
  258. void writeInfoPlistFile()
  259. {
  260. if (! hasPList())
  261. return;
  262. XmlElement plist ("plist");
  263. XmlElement* dict = plist.createNewChildElement ("dict");
  264. if (iPhone)
  265. addPlistDictionaryKeyBool (dict, "LSRequiresIPhoneOS", true);
  266. addPlistDictionaryKey (dict, "CFBundleExecutable", "${EXECUTABLE_NAME}");
  267. addPlistDictionaryKey (dict, "CFBundleIconFile", iconFile.exists() ? iconFile.getFileName() : String::empty);
  268. addPlistDictionaryKey (dict, "CFBundleIdentifier", project.getBundleIdentifier().toString());
  269. addPlistDictionaryKey (dict, "CFBundleName", project.getProjectName().toString());
  270. if (project.getProjectType().isAudioPlugin())
  271. {
  272. addPlistDictionaryKey (dict, "CFBundlePackageType", "TDMw");
  273. addPlistDictionaryKey (dict, "CFBundleSignature", "PTul");
  274. }
  275. else
  276. {
  277. addPlistDictionaryKey (dict, "CFBundlePackageType", "APPL");
  278. addPlistDictionaryKey (dict, "CFBundleSignature", "????");
  279. }
  280. addPlistDictionaryKey (dict, "CFBundleShortVersionString", project.getVersion().toString());
  281. addPlistDictionaryKey (dict, "CFBundleVersion", project.getVersion().toString());
  282. StringArray documentExtensions;
  283. documentExtensions.addTokens (replacePreprocessorDefs (getAllPreprocessorDefs(), getSetting ("documentExtensions").toString()),
  284. ",", String::empty);
  285. documentExtensions.trim();
  286. documentExtensions.removeEmptyStrings (true);
  287. if (documentExtensions.size() > 0)
  288. {
  289. dict->createNewChildElement ("key")->addTextElement ("CFBundleDocumentTypes");
  290. XmlElement* dict2 = dict->createNewChildElement ("array")->createNewChildElement ("dict");
  291. for (int i = 0; i < documentExtensions.size(); ++i)
  292. {
  293. String ex (documentExtensions[i]);
  294. if (ex.startsWithChar ('.'))
  295. ex = ex.substring (1);
  296. dict2->createNewChildElement ("key")->addTextElement ("CFBundleTypeExtensions");
  297. dict2->createNewChildElement ("array")->createNewChildElement ("string")->addTextElement (ex);
  298. addPlistDictionaryKey (dict2, "CFBundleTypeName", ex);
  299. addPlistDictionaryKey (dict2, "CFBundleTypeRole", "Editor");
  300. addPlistDictionaryKey (dict2, "NSPersistentStoreTypeKey", "XML");
  301. }
  302. }
  303. if (getSetting ("UIFileSharingEnabled").getValue())
  304. addPlistDictionaryKeyBool (dict, "UIFileSharingEnabled", true);
  305. if (getSetting ("UIStatusBarHidden").getValue())
  306. addPlistDictionaryKeyBool (dict, "UIStatusBarHidden", true);
  307. MemoryOutputStream mo;
  308. plist.writeToStream (mo, "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">");
  309. overwriteFileIfDifferentOrThrow (infoPlistFile, mo);
  310. }
  311. StringArray getHeaderSearchPaths (const Project::BuildConfiguration& config)
  312. {
  313. StringArray searchPaths (config.getHeaderSearchPaths());
  314. project.getProjectType().addExtraSearchPaths (*this, searchPaths);
  315. return searchPaths;
  316. }
  317. void getLinkerFlagsForStaticLibrary (const RelativePath& library, StringArray& flags, StringArray& librarySearchPaths)
  318. {
  319. jassert (library.getFileNameWithoutExtension().substring (0, 3) == "lib");
  320. flags.add ("-l" + library.getFileNameWithoutExtension().substring (3));
  321. String searchPath (library.toUnixStyle().upToLastOccurrenceOf ("/", false, false));
  322. if (! library.isAbsolute())
  323. searchPath = "$(SRCROOT)/" + searchPath;
  324. librarySearchPaths.add (sanitisePath (searchPath));
  325. }
  326. void getLinkerFlags (const Project::BuildConfiguration& config, StringArray& flags, StringArray& librarySearchPaths)
  327. {
  328. if (project.getProjectType().isAudioPlugin())
  329. {
  330. flags.add ("-bundle");
  331. if (isRTAS() && getRTASFolder().toString().isNotEmpty())
  332. {
  333. getLinkerFlagsForStaticLibrary (RelativePath (getRTASFolder().toString(), RelativePath::buildTargetFolder)
  334. .getChildFile (config.isDebug().getValue() ? "MacBag/Libs/Debug/libPluginLibrary.a"
  335. : "MacBag/Libs/Release/libPluginLibrary.a"),
  336. flags, librarySearchPaths);
  337. }
  338. }
  339. if (project.getJuceLinkageMode() == Project::useLinkedJuce)
  340. {
  341. RelativePath juceLib (getJucePathFromTargetFolder().getChildFile (config.isDebug().getValue() ? "bin/libjucedebug.a"
  342. : "bin/libjuce.a"));
  343. getLinkerFlagsForStaticLibrary (juceLib, flags, librarySearchPaths);
  344. }
  345. flags.add (replacePreprocessorTokens (config, getExtraLinkerFlags().toString()));
  346. flags.removeEmptyStrings (true);
  347. }
  348. StringArray getProjectSettings (const Project::BuildConfiguration& config)
  349. {
  350. StringArray s;
  351. s.add ("ALWAYS_SEARCH_USER_PATHS = NO");
  352. s.add ("GCC_C_LANGUAGE_STANDARD = c99");
  353. s.add ("GCC_WARN_ABOUT_RETURN_TYPE = YES");
  354. s.add ("GCC_WARN_CHECK_SWITCH_STATEMENTS = YES");
  355. s.add ("GCC_WARN_UNUSED_VARIABLE = YES");
  356. s.add ("GCC_WARN_MISSING_PARENTHESES = YES");
  357. s.add ("GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES");
  358. s.add ("GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES");
  359. s.add ("WARNING_CFLAGS = -Wreorder");
  360. s.add ("GCC_MODEL_TUNING = G5");
  361. if (project.getProjectType().isLibrary() || project.getJuceLinkageMode() == Project::useLinkedJuce)
  362. {
  363. s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = NO");
  364. s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = NO");
  365. }
  366. else
  367. {
  368. s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES");
  369. }
  370. if (iPhone)
  371. {
  372. s.add ("\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\"");
  373. s.add ("SDKROOT = iphoneos");
  374. s.add ("TARGETED_DEVICE_FAMILY = \"1,2\"");
  375. }
  376. s.add ("ZERO_LINK = NO");
  377. if (! isRTAS()) // (dwarf seems to be incompatible with the RTAS libs)
  378. s.add ("DEBUG_INFORMATION_FORMAT = \"dwarf\"");
  379. s.add ("PRODUCT_NAME = \"" + config.getTargetBinaryName().toString() + "\"");
  380. return s;
  381. }
  382. StringArray getTargetSettings (const Project::BuildConfiguration& config)
  383. {
  384. StringArray s;
  385. const String arch (config.getMacArchitecture().toString());
  386. if (arch == Project::BuildConfiguration::osxArch_Native) s.add ("ARCHS = \"$(ARCHS_NATIVE)\"");
  387. else if (arch == Project::BuildConfiguration::osxArch_32BitUniversal) s.add ("ARCHS = \"$(ARCHS_STANDARD_32_BIT)\"");
  388. else if (arch == Project::BuildConfiguration::osxArch_64BitUniversal) s.add ("ARCHS = \"$(ARCHS_STANDARD_32_64_BIT)\"");
  389. else if (arch == Project::BuildConfiguration::osxArch_64Bit) s.add ("ARCHS = \"$(ARCHS_STANDARD_64_BIT)\"");
  390. s.add ("PREBINDING = NO");
  391. s.add ("HEADER_SEARCH_PATHS = \"" + replacePreprocessorTokens (config, getHeaderSearchPaths (config).joinIntoString (" ")) + " $(inherited)\"");
  392. s.add ("GCC_OPTIMIZATION_LEVEL = " + config.getGCCOptimisationFlag());
  393. s.add ("INFOPLIST_FILE = " + infoPlistFile.getFileName());
  394. const String extraFlags (replacePreprocessorTokens (config, getExtraCompilerFlags().toString()).trim());
  395. if (extraFlags.isNotEmpty())
  396. s.add ("OTHER_CPLUSPLUSFLAGS = " + extraFlags);
  397. if (project.getProjectType().isGUIApplication())
  398. {
  399. s.add ("INSTALL_PATH = \"$(HOME)/Applications\"");
  400. }
  401. else if (project.getProjectType().isAudioPlugin())
  402. {
  403. s.add ("LIBRARY_STYLE = Bundle");
  404. s.add ("INSTALL_PATH = \"$(HOME)/Library/Audio/Plug-Ins/Components/\"");
  405. s.add ("WRAPPER_EXTENSION = " + getAudioPluginBundleExtension());
  406. s.add ("GENERATE_PKGINFO_FILE = YES");
  407. s.add ("OTHER_REZFLAGS = \"-d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64"
  408. " -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers"
  409. " -I \\\"$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/AUBase\\\"\"");
  410. }
  411. else if (project.getProjectType().isBrowserPlugin())
  412. {
  413. s.add ("LIBRARY_STYLE = Bundle");
  414. s.add ("INSTALL_PATH = \"/Library/Internet Plug-Ins/\"");
  415. }
  416. else if (project.getProjectType().isLibrary())
  417. {
  418. if (config.getTargetBinaryRelativePath().toString().isNotEmpty())
  419. {
  420. RelativePath binaryPath (config.getTargetBinaryRelativePath().toString(), RelativePath::projectFolder);
  421. binaryPath = binaryPath.rebased (project.getFile().getParentDirectory(), getTargetFolder(), RelativePath::buildTargetFolder);
  422. s.add ("DSTROOT = " + sanitisePath (binaryPath.toUnixStyle()));
  423. s.add ("SYMROOT = " + sanitisePath (binaryPath.toUnixStyle()));
  424. }
  425. s.add ("CONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\"");
  426. s.add ("DEPLOYMENT_LOCATION = YES");
  427. }
  428. else if (project.getProjectType().isCommandLineApp())
  429. {
  430. }
  431. else
  432. {
  433. jassertfalse;
  434. }
  435. if (! iPhone)
  436. {
  437. const String sdk (config.getMacSDKVersion().toString());
  438. const String sdkCompat (config.getMacCompatibilityVersion().toString());
  439. if (sdk == Project::BuildConfiguration::osxVersion10_4)
  440. {
  441. s.add ("SDKROOT = macosx10.4");
  442. s.add ("GCC_VERSION = 4.0");
  443. }
  444. else if (sdk == Project::BuildConfiguration::osxVersion10_5)
  445. {
  446. s.add ("SDKROOT = macosx10.5");
  447. }
  448. else if (sdk == Project::BuildConfiguration::osxVersion10_6)
  449. {
  450. s.add ("SDKROOT = macosx10.6");
  451. }
  452. if (sdkCompat == Project::BuildConfiguration::osxVersion10_4) s.add ("MACOSX_DEPLOYMENT_TARGET = 10.4");
  453. else if (sdkCompat == Project::BuildConfiguration::osxVersion10_5) s.add ("MACOSX_DEPLOYMENT_TARGET = 10.5");
  454. else if (sdkCompat == Project::BuildConfiguration::osxVersion10_6) s.add ("MACOSX_DEPLOYMENT_TARGET = 10.6");
  455. s.add ("MACOSX_DEPLOYMENT_TARGET_ppc = 10.4");
  456. }
  457. {
  458. StringArray linkerFlags, librarySearchPaths;
  459. getLinkerFlags (config, linkerFlags, librarySearchPaths);
  460. if (linkerFlags.size() > 0)
  461. s.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (" ") + "\"");
  462. if (librarySearchPaths.size() > 0)
  463. {
  464. String libPaths ("LIBRARY_SEARCH_PATHS = (\"$(inherited)\"");
  465. for (int i = 0; i < librarySearchPaths.size(); ++i)
  466. libPaths += ", \"\\\"" + librarySearchPaths[i] + "\\\"\"";
  467. s.add (libPaths + ")");
  468. }
  469. }
  470. StringPairArray defines;
  471. if (config.isDebug().getValue())
  472. {
  473. defines.set ("_DEBUG", "1");
  474. defines.set ("DEBUG", "1");
  475. s.add ("ONLY_ACTIVE_ARCH = YES");
  476. s.add ("COPY_PHASE_STRIP = NO");
  477. s.add ("GCC_DYNAMIC_NO_PIC = NO");
  478. s.add ("GCC_ENABLE_FIX_AND_CONTINUE = NO");
  479. }
  480. else
  481. {
  482. defines.set ("_NDEBUG", "1");
  483. defines.set ("NDEBUG", "1");
  484. s.add ("GCC_GENERATE_DEBUGGING_SYMBOLS = NO");
  485. s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = YES");
  486. }
  487. {
  488. const String objCSuffix (getObjCSuffix().toString().trim());
  489. if (objCSuffix.isNotEmpty())
  490. defines.set ("JUCE_ObjCExtraSuffix", replacePreprocessorTokens (config, objCSuffix));
  491. }
  492. {
  493. defines = mergePreprocessorDefs (defines, getAllPreprocessorDefs (config));
  494. StringArray defsList;
  495. for (int i = 0; i < defines.size(); ++i)
  496. {
  497. String def (defines.getAllKeys()[i]);
  498. const String value (defines.getAllValues()[i]);
  499. if (value.isNotEmpty())
  500. def << "=" << value;
  501. defsList.add (def.quoted());
  502. }
  503. s.add ("GCC_PREPROCESSOR_DEFINITIONS = (" + indentList (defsList, ",") + ")");
  504. }
  505. return s;
  506. }
  507. void addFrameworks()
  508. {
  509. StringArray s;
  510. if (iPhone)
  511. {
  512. s.addTokens ("UIKit Foundation CoreGraphics CoreText AudioToolbox QuartzCore OpenGLES", false);
  513. }
  514. else
  515. {
  516. s.addTokens ("Cocoa Carbon IOKit CoreAudio CoreMIDI WebKit DiscRecording OpenGL QuartzCore QTKit QuickTime", false);
  517. if (isAU())
  518. s.addTokens ("AudioUnit CoreAudioKit AudioToolbox", false);
  519. else if (project.getJuceConfigFlag ("JUCE_PLUGINHOST_AU").toString() == Project::configFlagEnabled)
  520. s.addTokens ("AudioUnit CoreAudioKit", false);
  521. }
  522. for (int i = 0; i < s.size(); ++i)
  523. addFramework (s[i]);
  524. }
  525. //==============================================================================
  526. void writeProjectFile (OutputStream& output)
  527. {
  528. output << "// !$*UTF8*$!\n{\n"
  529. "\tarchiveVersion = 1;\n"
  530. "\tclasses = {\n\t};\n"
  531. "\tobjectVersion = 45;\n"
  532. "\tobjects = {\n\n";
  533. Array <ValueTree*> objects;
  534. objects.addArray (pbxBuildFiles);
  535. objects.addArray (pbxFileReferences);
  536. objects.addArray (groups);
  537. objects.addArray (targetConfigs);
  538. objects.addArray (projectConfigs);
  539. objects.addArray (misc);
  540. for (int i = 0; i < objects.size(); ++i)
  541. {
  542. ValueTree& o = *objects.getUnchecked(i);
  543. output << "\t\t" << o.getType().toString() << " = { ";
  544. for (int j = 0; j < o.getNumProperties(); ++j)
  545. {
  546. const Identifier propertyName (o.getPropertyName(j));
  547. String val (o.getProperty (propertyName).toString());
  548. if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,&+-_\r\n")
  549. && ! (val.trimStart().startsWithChar ('(')
  550. || val.trimStart().startsWithChar ('{'))))
  551. val = val.quoted();
  552. output << propertyName.toString() << " = " << val << "; ";
  553. }
  554. output << "};\n";
  555. }
  556. output << "\t};\n\trootObject = " << createID ("__root") << ";\n}\n";
  557. }
  558. static void addPlistDictionaryKey (XmlElement* xml, const String& key, const String& value)
  559. {
  560. xml->createNewChildElement ("key")->addTextElement (key);
  561. xml->createNewChildElement ("string")->addTextElement (value);
  562. }
  563. static void addPlistDictionaryKeyBool (XmlElement* xml, const String& key, const bool value)
  564. {
  565. xml->createNewChildElement ("key")->addTextElement (key);
  566. xml->createNewChildElement (value ? "true" : "false");
  567. }
  568. String addBuildFile (const RelativePath& path, const String& fileRefID, bool addToSourceBuildPhase, bool inhibitWarnings)
  569. {
  570. String fileID (createID (path.toUnixStyle() + "buildref"));
  571. if (addToSourceBuildPhase)
  572. sourceIDs.add (fileID);
  573. ValueTree* v = new ValueTree (fileID);
  574. v->setProperty ("isa", "PBXBuildFile", 0);
  575. v->setProperty ("fileRef", fileRefID, 0);
  576. if (inhibitWarnings)
  577. v->setProperty ("settings", "{COMPILER_FLAGS = \"-w\"; }", 0);
  578. pbxBuildFiles.add (v);
  579. return fileID;
  580. }
  581. String addBuildFile (const RelativePath& path, bool addToSourceBuildPhase, bool inhibitWarnings)
  582. {
  583. return addBuildFile (path, createID (path), addToSourceBuildPhase, inhibitWarnings);
  584. }
  585. void addFileReference (const RelativePath& path, const String& sourceTree, const String& lastKnownFileType, const String& fileRefID)
  586. {
  587. ValueTree* v = new ValueTree (fileRefID);
  588. v->setProperty ("isa", "PBXFileReference", 0);
  589. v->setProperty ("lastKnownFileType", lastKnownFileType, 0);
  590. v->setProperty (Ids::name, path.getFileName(), 0);
  591. v->setProperty ("path", sanitisePath (path.toUnixStyle()), 0);
  592. v->setProperty ("sourceTree", sourceTree, 0);
  593. pbxFileReferences.add (v);
  594. }
  595. String addFileReference (const RelativePath& path)
  596. {
  597. const String fileRefID (createID (path));
  598. jassert (path.isAbsolute() || path.getRoot() == RelativePath::buildTargetFolder);
  599. addFileReference (path, path.isAbsolute() ? "<absolute>" : "SOURCE_ROOT",
  600. getFileType (path), fileRefID);
  601. return fileRefID;
  602. }
  603. static String getFileType (const RelativePath& file)
  604. {
  605. if (file.hasFileExtension ("cpp;cc;cxx")) return "sourcecode.cpp.cpp";
  606. else if (file.hasFileExtension (".mm")) return "sourcecode.cpp.objcpp";
  607. else if (file.hasFileExtension (".m")) return "sourcecode.c.objc";
  608. else if (file.hasFileExtension (headerFileExtensions)) return "sourcecode.c.h";
  609. else if (file.hasFileExtension (".framework")) return "wrapper.framework";
  610. else if (file.hasFileExtension (".jpeg;.jpg")) return "image.jpeg";
  611. else if (file.hasFileExtension ("png;gif")) return "image" + file.getFileExtension();
  612. else if (file.hasFileExtension ("html;htm")) return "text.html";
  613. else if (file.hasFileExtension ("txt;rtf")) return "text" + file.getFileExtension();
  614. else if (file.hasFileExtension ("plist")) return "text.plist.xml";
  615. else if (file.hasFileExtension ("app")) return "wrapper.application";
  616. else if (file.hasFileExtension ("component;vst;plugin")) return "wrapper.cfbundle";
  617. else if (file.hasFileExtension ("xcodeproj")) return "wrapper.pb-project";
  618. else if (file.hasFileExtension ("a")) return "archive.ar";
  619. return "file" + file.getFileExtension();
  620. }
  621. String addFile (const RelativePath& path, bool shouldBeCompiled, bool inhibitWarnings)
  622. {
  623. if (shouldBeCompiled)
  624. addBuildFile (path, true, inhibitWarnings);
  625. else if (path.hasFileExtension (".r"))
  626. rezFileIDs.add (addBuildFile (path, false, inhibitWarnings));
  627. return addFileReference (path);
  628. }
  629. String addProjectItem (const Project::Item& projectItem, const String& groupID, bool inhibitWarnings)
  630. {
  631. if (projectItem.isGroup())
  632. {
  633. StringArray childIDs;
  634. for (int i = 0; i < projectItem.getNumChildren(); ++i)
  635. {
  636. const String childID (addProjectItem (projectItem.getChild(i), String::empty, inhibitWarnings));
  637. if (childID.isNotEmpty())
  638. childIDs.add (childID);
  639. }
  640. return addGroup (projectItem, childIDs, groupID);
  641. }
  642. else
  643. {
  644. if (projectItem.shouldBeAddedToTargetProject())
  645. {
  646. const RelativePath path (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder);
  647. return addFile (path, projectItem.shouldBeCompiled(), inhibitWarnings);
  648. }
  649. }
  650. return String::empty;
  651. }
  652. void addFramework (const String& frameworkName)
  653. {
  654. const RelativePath path ("System/Library/Frameworks/" + frameworkName + ".framework", RelativePath::unknown);
  655. const String fileRefID (createID (path));
  656. addFileReference (path, "SDKROOT", getFileType (path), fileRefID);
  657. frameworkIDs.add (addBuildFile (path, fileRefID, false, false));
  658. frameworkFileIDs.add (fileRefID);
  659. }
  660. void addGroup (const String& groupID, const String& groupName, const StringArray& childIDs)
  661. {
  662. ValueTree* v = new ValueTree (groupID);
  663. v->setProperty ("isa", "PBXGroup", 0);
  664. v->setProperty ("children", "(" + indentList (childIDs, ",") + " )", 0);
  665. v->setProperty (Ids::name, groupName, 0);
  666. v->setProperty ("sourceTree", "<group>", 0);
  667. groups.add (v);
  668. }
  669. String addGroup (const Project::Item& item, StringArray& childIDs, String groupID)
  670. {
  671. String groupName (item.getName().toString());
  672. if (item.isMainGroup())
  673. {
  674. groupName = "Source";
  675. if (libraryFilesGroup.getNumChildren() > 0)
  676. childIDs.add (addProjectItem (libraryFilesGroup, createID ("__jucelibfiles"), false));
  677. if (isVST())
  678. childIDs.add (addProjectItem (createVSTGroup (true), createID ("__jucevstfiles"), false));
  679. if (isAU())
  680. childIDs.add (createAUWrappersGroup());
  681. if (isRTAS())
  682. childIDs.add (addProjectItem (createRTASGroup (true), createID ("__jucertasfiles"), true));
  683. { // Add 'resources' group
  684. String resourcesGroupID (createID ("__resources"));
  685. addGroup (resourcesGroupID, "Resources", resourceFileRefs);
  686. childIDs.add (resourcesGroupID);
  687. }
  688. { // Add 'frameworks' group
  689. String frameworksGroupID (createID ("__frameworks"));
  690. addGroup (frameworksGroupID, "Frameworks", frameworkFileIDs);
  691. childIDs.add (frameworksGroupID);
  692. }
  693. { // Add 'products' group
  694. String productsGroupID (createID ("__products"));
  695. StringArray products;
  696. products.add (createID ("__productFileID"));
  697. addGroup (productsGroupID, "Products", products);
  698. childIDs.add (productsGroupID);
  699. }
  700. }
  701. if (groupID.isEmpty())
  702. groupID = getIDForGroup (item);
  703. addGroup (groupID, groupName, childIDs);
  704. return groupID;
  705. }
  706. void addBuildProduct (const String& fileType, const String& binaryName)
  707. {
  708. ValueTree* v = new ValueTree (createID ("__productFileID"));
  709. v->setProperty ("isa", "PBXFileReference", 0);
  710. v->setProperty ("explicitFileType", fileType, 0);
  711. v->setProperty ("includeInIndex", (int) 0, 0);
  712. v->setProperty ("path", sanitisePath (binaryName), 0);
  713. v->setProperty ("sourceTree", "BUILT_PRODUCTS_DIR", 0);
  714. pbxFileReferences.add (v);
  715. }
  716. void addTargetConfig (const String& configName, const StringArray& buildSettings)
  717. {
  718. ValueTree* v = new ValueTree (createID ("targetconfigid_" + configName));
  719. v->setProperty ("isa", "XCBuildConfiguration", 0);
  720. v->setProperty ("buildSettings", "{" + indentList (buildSettings, ";") + " }", 0);
  721. v->setProperty (Ids::name, configName, 0);
  722. targetConfigs.add (v);
  723. }
  724. void addProjectConfig (const String& configName, const StringArray& buildSettings)
  725. {
  726. ValueTree* v = new ValueTree (createID ("projectconfigid_" + configName));
  727. v->setProperty ("isa", "XCBuildConfiguration", 0);
  728. v->setProperty ("buildSettings", "{" + indentList (buildSettings, ";") + " }", 0);
  729. v->setProperty (Ids::name, configName, 0);
  730. projectConfigs.add (v);
  731. }
  732. void addConfigList (const OwnedArray <ValueTree>& configsToUse, const String& listID)
  733. {
  734. StringArray configIDs;
  735. for (int i = 0; i < configsToUse.size(); ++i)
  736. configIDs.add (configsToUse[i]->getType().toString());
  737. ValueTree* v = new ValueTree (listID);
  738. v->setProperty ("isa", "XCConfigurationList", 0);
  739. v->setProperty ("buildConfigurations", "(" + indentList (configIDs, ",") + " )", 0);
  740. v->setProperty ("defaultConfigurationIsVisible", (int) 0, 0);
  741. if (configsToUse[0] != nullptr)
  742. v->setProperty ("defaultConfigurationName", configsToUse[0]->getProperty (Ids::name), 0);
  743. misc.add (v);
  744. }
  745. ValueTree* addBuildPhase (const String& phaseType, const StringArray& fileIds)
  746. {
  747. String phaseId (createID (phaseType + "resbuildphase"));
  748. buildPhaseIDs.add (phaseId);
  749. ValueTree* v = new ValueTree (phaseId);
  750. v->setProperty ("isa", phaseType, 0);
  751. v->setProperty ("buildActionMask", "2147483647", 0);
  752. v->setProperty ("files", "(" + indentList (fileIds, ",") + " )", 0);
  753. v->setProperty ("runOnlyForDeploymentPostprocessing", (int) 0, 0);
  754. misc.add (v);
  755. return v;
  756. }
  757. void addTargetObject()
  758. {
  759. ValueTree* v = new ValueTree (createID ("__target"));
  760. v->setProperty ("isa", "PBXNativeTarget", 0);
  761. v->setProperty ("buildConfigurationList", createID ("__configList"), 0);
  762. v->setProperty ("buildPhases", "(" + indentList (buildPhaseIDs, ",") + " )", 0);
  763. v->setProperty ("buildRules", "( )", 0);
  764. v->setProperty ("dependencies", "( )", 0);
  765. v->setProperty (Ids::name, project.getDocumentTitle(), 0);
  766. v->setProperty ("productName", project.getDocumentTitle(), 0);
  767. v->setProperty ("productReference", createID ("__productFileID"), 0);
  768. if (project.getProjectType().isGUIApplication())
  769. {
  770. v->setProperty ("productInstallPath", "$(HOME)/Applications", 0);
  771. v->setProperty ("productType", "com.apple.product-type.application", 0);
  772. }
  773. else if (project.getProjectType().isCommandLineApp())
  774. {
  775. v->setProperty ("productInstallPath", "/usr/bin", 0);
  776. v->setProperty ("productType", "com.apple.product-type.tool", 0);
  777. }
  778. else if (project.getProjectType().isAudioPlugin() || project.getProjectType().isBrowserPlugin())
  779. {
  780. v->setProperty ("productInstallPath", "$(HOME)/Library/Audio/Plug-Ins/Components/", 0);
  781. v->setProperty ("productType", "com.apple.product-type.bundle", 0);
  782. }
  783. else if (project.getProjectType().isLibrary())
  784. {
  785. v->setProperty ("productType", "com.apple.product-type.library.static", 0);
  786. }
  787. else
  788. jassertfalse; //xxx
  789. misc.add (v);
  790. }
  791. void addProjectObject()
  792. {
  793. ValueTree* v = new ValueTree (createID ("__root"));
  794. v->setProperty ("isa", "PBXProject", 0);
  795. v->setProperty ("buildConfigurationList", createID ("__projList"), 0);
  796. v->setProperty ("compatibilityVersion", "Xcode 3.1", 0);
  797. v->setProperty ("hasScannedForEncodings", (int) 0, 0);
  798. v->setProperty ("mainGroup", getIDForGroup (project.getMainGroup()), 0);
  799. v->setProperty ("projectDirPath", "\"\"", 0);
  800. v->setProperty ("projectRoot", "\"\"", 0);
  801. v->setProperty ("targets", "( " + createID ("__target") + " )", 0);
  802. misc.add (v);
  803. }
  804. void addPluginShellScriptPhase()
  805. {
  806. ValueTree* v = addBuildPhase ("PBXShellScriptBuildPhase", StringArray());
  807. v->setProperty (Ids::name, "Copy to the different plugin folders", 0);
  808. v->setProperty ("shellPath", "/bin/sh", 0);
  809. v->setProperty ("shellScript", String::fromUTF8 (BinaryData::AudioPluginXCodeScript_txt, BinaryData::AudioPluginXCodeScript_txtSize)
  810. .replace ("\\", "\\\\")
  811. .replace ("\"", "\\\"")
  812. .replace ("\r\n", "\\n")
  813. .replace ("\n", "\\n"), 0);
  814. }
  815. //==============================================================================
  816. static String indentList (const StringArray& list, const String& separator)
  817. {
  818. if (list.size() == 0)
  819. return " ";
  820. return "\n\t\t\t\t" + list.joinIntoString (separator + "\n\t\t\t\t")
  821. + (separator == ";" ? separator : String::empty);
  822. }
  823. String createID (const RelativePath& path) const
  824. {
  825. return createID (path.toUnixStyle());
  826. }
  827. String createID (const String& rootString) const
  828. {
  829. static const char digits[] = "0123456789ABCDEF";
  830. char n[24];
  831. Random ran (projectIDSalt + hashCode64 (rootString));
  832. for (int i = 0; i < numElementsInArray (n); ++i)
  833. n[i] = digits [ran.nextInt (16)];
  834. return String (n, numElementsInArray (n));
  835. }
  836. String getIDForGroup (const Project::Item& item) const
  837. {
  838. return createID (item.getID());
  839. }
  840. bool shouldFileBeCompiledByDefault (const RelativePath& file) const
  841. {
  842. return file.hasFileExtension (sourceFileExtensions);
  843. }
  844. //==============================================================================
  845. String createAUWrappersGroup()
  846. {
  847. Array<RelativePath> auWrappers;
  848. const char* files[] = { JUCE_PLUGINS_PATH_AU "juce_AU_Resources.r",
  849. JUCE_PLUGINS_PATH_AU "juce_AU_Wrapper.mm" };
  850. int i;
  851. for (i = 0; i < numElementsInArray (files); ++i)
  852. auWrappers.add (getJucePathFromTargetFolder().getChildFile (files[i]));
  853. #define JUCE_AU_PUBLICUTILITY "Extras/CoreAudio/PublicUtility/"
  854. #define JUCE_AU_PUBLIC "Extras/CoreAudio/AudioUnits/AUPublic/"
  855. const char* appleAUFiles[] = { JUCE_AU_PUBLICUTILITY "CADebugMacros.h",
  856. JUCE_AU_PUBLICUTILITY "CAAUParameter.cpp",
  857. JUCE_AU_PUBLICUTILITY "CAAUParameter.h",
  858. JUCE_AU_PUBLICUTILITY "CAAudioChannelLayout.cpp",
  859. JUCE_AU_PUBLICUTILITY "CAAudioChannelLayout.h",
  860. JUCE_AU_PUBLICUTILITY "CAMutex.cpp",
  861. JUCE_AU_PUBLICUTILITY "CAMutex.h",
  862. JUCE_AU_PUBLICUTILITY "CAStreamBasicDescription.cpp",
  863. JUCE_AU_PUBLICUTILITY "CAStreamBasicDescription.h",
  864. JUCE_AU_PUBLICUTILITY "CAVectorUnitTypes.h",
  865. JUCE_AU_PUBLICUTILITY "CAVectorUnit.cpp",
  866. JUCE_AU_PUBLICUTILITY "CAVectorUnit.h",
  867. JUCE_AU_PUBLIC "AUViewBase/AUViewLocalizedStringKeys.h",
  868. JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewDispatch.cpp",
  869. JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewControl.cpp",
  870. JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewControl.h",
  871. JUCE_AU_PUBLIC "AUCarbonViewBase/CarbonEventHandler.cpp",
  872. JUCE_AU_PUBLIC "AUCarbonViewBase/CarbonEventHandler.h",
  873. JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewBase.cpp",
  874. JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewBase.h",
  875. JUCE_AU_PUBLIC "AUBase/AUBase.cpp",
  876. JUCE_AU_PUBLIC "AUBase/AUBase.h",
  877. JUCE_AU_PUBLIC "AUBase/AUDispatch.cpp",
  878. JUCE_AU_PUBLIC "AUBase/AUDispatch.h",
  879. JUCE_AU_PUBLIC "AUBase/AUInputElement.cpp",
  880. JUCE_AU_PUBLIC "AUBase/AUInputElement.h",
  881. JUCE_AU_PUBLIC "AUBase/AUOutputElement.cpp",
  882. JUCE_AU_PUBLIC "AUBase/AUOutputElement.h",
  883. JUCE_AU_PUBLIC "AUBase/AUResources.r",
  884. JUCE_AU_PUBLIC "AUBase/AUScopeElement.cpp",
  885. JUCE_AU_PUBLIC "AUBase/AUScopeElement.h",
  886. JUCE_AU_PUBLIC "AUBase/ComponentBase.cpp",
  887. JUCE_AU_PUBLIC "AUBase/ComponentBase.h",
  888. JUCE_AU_PUBLIC "OtherBases/AUMIDIBase.cpp",
  889. JUCE_AU_PUBLIC "OtherBases/AUMIDIBase.h",
  890. JUCE_AU_PUBLIC "OtherBases/AUMIDIEffectBase.cpp",
  891. JUCE_AU_PUBLIC "OtherBases/AUMIDIEffectBase.h",
  892. JUCE_AU_PUBLIC "OtherBases/AUOutputBase.cpp",
  893. JUCE_AU_PUBLIC "OtherBases/AUOutputBase.h",
  894. JUCE_AU_PUBLIC "OtherBases/MusicDeviceBase.cpp",
  895. JUCE_AU_PUBLIC "OtherBases/MusicDeviceBase.h",
  896. JUCE_AU_PUBLIC "OtherBases/AUEffectBase.cpp",
  897. JUCE_AU_PUBLIC "OtherBases/AUEffectBase.h",
  898. JUCE_AU_PUBLIC "Utility/AUBuffer.cpp",
  899. JUCE_AU_PUBLIC "Utility/AUBuffer.h",
  900. JUCE_AU_PUBLIC "Utility/AUDebugDispatcher.cpp",
  901. JUCE_AU_PUBLIC "Utility/AUDebugDispatcher.h",
  902. JUCE_AU_PUBLIC "Utility/AUInputFormatConverter.h",
  903. JUCE_AU_PUBLIC "Utility/AUSilentTimeout.h",
  904. JUCE_AU_PUBLIC "Utility/AUTimestampGenerator.h" };
  905. StringArray fileIDs, appleFileIDs;
  906. for (i = 0; i < auWrappers.size(); ++i)
  907. {
  908. addFile (auWrappers.getReference(i), shouldFileBeCompiledByDefault (auWrappers.getReference(i)), false);
  909. fileIDs.add (createID (auWrappers.getReference(i)));
  910. }
  911. for (i = 0; i < numElementsInArray (appleAUFiles); ++i)
  912. {
  913. RelativePath file (appleAUFiles[i], RelativePath::unknown);
  914. const String fileRefID (createID (file));
  915. addFileReference (file, "DEVELOPER_DIR", getFileType (file), fileRefID);
  916. if (shouldFileBeCompiledByDefault (file))
  917. addBuildFile (file, fileRefID, true, true);
  918. appleFileIDs.add (fileRefID);
  919. }
  920. const String appleGroupID (createID ("__juceappleaufiles"));
  921. addGroup (appleGroupID, "Apple AU Files", appleFileIDs);
  922. fileIDs.add (appleGroupID);
  923. const String groupID (createID ("__juceaufiles"));
  924. addGroup (groupID, "Juce AU Wrapper", fileIDs);
  925. return groupID;
  926. }
  927. };
  928. #endif // __JUCER_PROJECTEXPORT_XCODE_JUCEHEADER__