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.

1186 lines
52KB

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