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* 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. }
  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 (rebaseFromProjectFolderToBuildTarget (RelativePath (getVSTFolder().toString(), RelativePath::projectFolder)).toUnixStyle());
  303. if (project.isAudioPlugin())
  304. {
  305. if (isAU())
  306. {
  307. searchPaths.add ("$(DEVELOPER_DIR)/Extras/CoreAudio/PublicUtility");
  308. searchPaths.add ("$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/Utility");
  309. }
  310. if (isRTAS())
  311. {
  312. searchPaths.add ("/Developer/Headers/FlatCarbon");
  313. static const char* rtasIncludePaths[] = { "AlturaPorts/TDMPlugIns/PlugInLibrary/Controls",
  314. "AlturaPorts/TDMPlugIns/PlugInLibrary/CoreClasses",
  315. "AlturaPorts/TDMPlugIns/PlugInLibrary/DSPClasses",
  316. "AlturaPorts/TDMPlugIns/PlugInLibrary/EffectClasses",
  317. "AlturaPorts/TDMPlugIns/PlugInLibrary/MacBuild",
  318. "AlturaPorts/TDMPlugIns/PlugInLibrary/Meters",
  319. "AlturaPorts/TDMPlugIns/PlugInLibrary/ProcessClasses",
  320. "AlturaPorts/TDMPlugIns/PlugInLibrary/ProcessClasses/Interfaces",
  321. "AlturaPorts/TDMPlugIns/PlugInLibrary/RTASP_Adapt",
  322. "AlturaPorts/TDMPlugIns/PlugInLibrary/Utilities",
  323. "AlturaPorts/TDMPlugIns/PlugInLibrary/ViewClasses",
  324. "AlturaPorts/TDMPlugIns/DSPManager/**",
  325. "AlturaPorts/TDMPlugIns/SupplementalPlugInLib/Encryption",
  326. "AlturaPorts/TDMPlugIns/SupplementalPlugInLib/GraphicsExtensions",
  327. "AlturaPorts/TDMPlugIns/common",
  328. "AlturaPorts/TDMPlugIns/common/PI_LibInterface",
  329. "AlturaPorts/TDMPlugIns/PACEProtection/**",
  330. "AlturaPorts/TDMPlugIns/SignalProcessing/**",
  331. "AlturaPorts/OMS/Headers",
  332. "AlturaPorts/Fic/Interfaces/**",
  333. "AlturaPorts/Fic/Source/SignalNets",
  334. "AlturaPorts/DSIPublicInterface/PublicHeaders",
  335. "DAEWin/Include",
  336. "AlturaPorts/DigiPublic/Interfaces",
  337. "AlturaPorts/DigiPublic",
  338. "AlturaPorts/NewFileLibs/DOA",
  339. "AlturaPorts/NewFileLibs/Cmn",
  340. "xplat/AVX/avx2/avx2sdk/inc",
  341. "xplat/AVX/avx2/avx2sdk/utils" };
  342. RelativePath sdkFolder (getRTASFolder().toString(), RelativePath::projectFolder);
  343. for (int i = 0; i < numElementsInArray (rtasIncludePaths); ++i)
  344. searchPaths.add (rebaseFromProjectFolderToBuildTarget (sdkFolder.getChildFile (rtasIncludePaths[i])).toUnixStyle());
  345. }
  346. }
  347. return searchPaths;
  348. }
  349. void getLinkerFlagsForStaticLibrary (const RelativePath& library, StringArray& flags, StringArray& librarySearchPaths)
  350. {
  351. jassert (library.getFileNameWithoutExtension().substring (0, 3) == "lib");
  352. flags.add ("-l" + library.getFileNameWithoutExtension().substring (3));
  353. String searchPath (library.toUnixStyle().upToLastOccurrenceOf ("/", false, false));
  354. if (! library.isAbsolute())
  355. searchPath = "$(SRCROOT)/" + searchPath;
  356. librarySearchPaths.add (sanitisePath (searchPath));
  357. }
  358. void getLinkerFlags (const Project::BuildConfiguration& config, StringArray& flags, StringArray& librarySearchPaths)
  359. {
  360. if (project.isAudioPlugin())
  361. {
  362. flags.add ("-bundle");
  363. if (isRTAS() && getRTASFolder().toString().isNotEmpty())
  364. {
  365. getLinkerFlagsForStaticLibrary (RelativePath (getRTASFolder().toString(), RelativePath::buildTargetFolder)
  366. .getChildFile (config.isDebug().getValue() ? "MacBag/Libs/Debug/libPluginLibrary.a"
  367. : "MacBag/Libs/Release/libPluginLibrary.a"),
  368. flags, librarySearchPaths);
  369. }
  370. }
  371. if (project.getJuceLinkageMode() == Project::useLinkedJuce)
  372. {
  373. RelativePath juceLib (getJucePathFromTargetFolder().getChildFile (config.isDebug().getValue() ? "bin/libjucedebug.a"
  374. : "bin/libjuce.a"));
  375. getLinkerFlagsForStaticLibrary (juceLib, flags, librarySearchPaths);
  376. }
  377. flags.add (getExtraLinkerFlags().toString());
  378. flags.removeEmptyStrings (true);
  379. }
  380. const StringArray getProjectSettings (const Project::BuildConfiguration& config)
  381. {
  382. StringArray s;
  383. s.add ("ALWAYS_SEARCH_USER_PATHS = NO");
  384. s.add ("GCC_C_LANGUAGE_STANDARD = c99");
  385. s.add ("GCC_WARN_ABOUT_RETURN_TYPE = YES");
  386. s.add ("GCC_WARN_CHECK_SWITCH_STATEMENTS = YES");
  387. s.add ("GCC_WARN_UNUSED_VARIABLE = YES");
  388. s.add ("GCC_WARN_MISSING_PARENTHESES = YES");
  389. s.add ("GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES");
  390. s.add ("GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES");
  391. s.add ("GCC_MODEL_TUNING = G5");
  392. if (project.isLibrary() || project.getJuceLinkageMode() == Project::useLinkedJuce)
  393. {
  394. s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = NO");
  395. s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = NO");
  396. }
  397. else
  398. {
  399. s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES");
  400. }
  401. s.add ("ZERO_LINK = NO");
  402. if (! isRTAS()) // (dwarf seems to be incompatible with the RTAS libs)
  403. s.add ("DEBUG_INFORMATION_FORMAT = \"dwarf\"");
  404. s.add ("PRODUCT_NAME = \"" + config.getTargetBinaryName().toString() + "\"");
  405. return s;
  406. }
  407. const StringArray getTargetSettings (const Project::BuildConfiguration& config)
  408. {
  409. StringArray s;
  410. s.add ("ARCHS = \"$(ARCHS_STANDARD_32_BIT)\"");
  411. s.add ("PREBINDING = NO");
  412. s.add ("HEADER_SEARCH_PATHS = \"" + getHeaderSearchPaths (config).joinIntoString (" ") + " $(inherited)\"");
  413. s.add ("GCC_OPTIMIZATION_LEVEL = " + config.getGCCOptimisationFlag());
  414. s.add ("INFOPLIST_FILE = " + infoPlistFile.getFileName());
  415. if (getExtraCompilerFlags().toString().isNotEmpty())
  416. s.add ("OTHER_CPLUSPLUSFLAGS = " + getExtraCompilerFlags().toString());
  417. if (project.isGUIApplication())
  418. {
  419. s.add ("INSTALL_PATH = \"$(HOME)/Applications\"");
  420. }
  421. else if (project.isAudioPlugin())
  422. {
  423. s.add ("LIBRARY_STYLE = Bundle");
  424. s.add ("INSTALL_PATH = \"$(HOME)/Library/Audio/Plug-Ins/Components/\"");
  425. s.add ("WRAPPER_EXTENSION = " + getAudioPluginBundleExtension());
  426. s.add ("GENERATE_PKGINFO_FILE = YES");
  427. s.add ("OTHER_REZFLAGS = \"-d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64"
  428. " -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers"
  429. " -I \\\"$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/AUBase\\\"\"");
  430. }
  431. else if (project.isBrowserPlugin())
  432. {
  433. s.add ("LIBRARY_STYLE = Bundle");
  434. s.add ("INSTALL_PATH = \"/Library/Internet Plug-Ins/\"");
  435. }
  436. else if (project.isLibrary())
  437. {
  438. if (config.getTargetBinaryRelativePath().toString().isNotEmpty())
  439. {
  440. RelativePath binaryPath (config.getTargetBinaryRelativePath().toString(), RelativePath::projectFolder);
  441. binaryPath = binaryPath.rebased (project.getFile().getParentDirectory(), getTargetFolder(), RelativePath::buildTargetFolder);
  442. s.add ("DSTROOT = " + sanitisePath (binaryPath.toUnixStyle()));
  443. s.add ("SYMROOT = " + sanitisePath (binaryPath.toUnixStyle()));
  444. }
  445. s.add ("CONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\"");
  446. s.add ("DEPLOYMENT_LOCATION = YES");
  447. }
  448. else if (project.isCommandLineApp())
  449. {
  450. }
  451. else
  452. {
  453. jassertfalse;
  454. }
  455. if (iPhone)
  456. {
  457. s.add ("SDKROOT = iphonesimulator3.2");
  458. }
  459. else
  460. {
  461. const String sdk (config.getMacSDKVersion().toString());
  462. const String sdkCompat (config.getMacCompatibilityVersion().toString());
  463. if (sdk == Project::BuildConfiguration::osxVersion10_4)
  464. {
  465. s.add ("SDKROOT = macosx10.4");
  466. s.add ("GCC_VERSION = 4.0");
  467. }
  468. else if (sdk == Project::BuildConfiguration::osxVersion10_5)
  469. {
  470. s.add ("SDKROOT = macosx10.5");
  471. }
  472. else if (sdk == Project::BuildConfiguration::osxVersion10_6)
  473. {
  474. s.add ("SDKROOT = macosx10.6");
  475. }
  476. if (sdkCompat == Project::BuildConfiguration::osxVersion10_4)
  477. s.add ("MACOSX_DEPLOYMENT_TARGET = 10.4");
  478. else if (sdkCompat == Project::BuildConfiguration::osxVersion10_5)
  479. s.add ("MACOSX_DEPLOYMENT_TARGET = 10.5");
  480. else if (sdkCompat == Project::BuildConfiguration::osxVersion10_6)
  481. s.add ("MACOSX_DEPLOYMENT_TARGET = 10.6");
  482. s.add ("MACOSX_DEPLOYMENT_TARGET_ppc = 10.4");
  483. }
  484. {
  485. StringArray linkerFlags, librarySearchPaths;
  486. getLinkerFlags (config, linkerFlags, librarySearchPaths);
  487. if (linkerFlags.size() > 0)
  488. s.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (" ") + "\"");
  489. if (librarySearchPaths.size() > 0)
  490. {
  491. String libPaths ("LIBRARY_SEARCH_PATHS = (\"$(inherited)\"");
  492. for (int i = 0; i < librarySearchPaths.size(); ++i)
  493. libPaths += ", \"\\\"" + librarySearchPaths[i] + "\\\"\"";
  494. s.add (libPaths + ")");
  495. }
  496. }
  497. StringArray defines;
  498. defines.add (getExporterIdentifierMacro() + "=1");
  499. if (config.isDebug().getValue())
  500. {
  501. defines.add ("_DEBUG=1");
  502. defines.add ("DEBUG=1 ");
  503. s.add ("ONLY_ACTIVE_ARCH = YES");
  504. s.add ("COPY_PHASE_STRIP = NO");
  505. s.add ("GCC_DYNAMIC_NO_PIC = NO");
  506. s.add ("GCC_ENABLE_FIX_AND_CONTINUE = NO");
  507. }
  508. else
  509. {
  510. defines.add ("_NDEBUG=1");
  511. defines.add ("NDEBUG=1 ");
  512. s.add ("GCC_GENERATE_DEBUGGING_SYMBOLS = NO");
  513. s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = YES");
  514. }
  515. {
  516. const String objCSuffix (getSetting ("objCExtraSuffix").toString().trim());
  517. if (objCSuffix.isNotEmpty())
  518. defines.add ("JUCE_ObjCExtraSuffix=" + objCSuffix);
  519. }
  520. {
  521. defines.addArray (config.parsePreprocessorDefs());
  522. defines.addArray (parsePreprocessorDefs());
  523. for (int i = defines.size(); --i >= 0;)
  524. defines.set (i, defines[i].quoted());
  525. s.add ("GCC_PREPROCESSOR_DEFINITIONS = (" + indentList (defines, ",") + ")");
  526. }
  527. return s;
  528. }
  529. void addFrameworks()
  530. {
  531. StringArray s;
  532. if (iPhone)
  533. {
  534. s.addTokens ("UIKit Foundation CoreGraphics AudioToolbox QuartzCore OpenGLES", false);
  535. }
  536. else
  537. {
  538. s.addTokens ("Cocoa Carbon IOKit CoreAudio CoreMIDI WebKit DiscRecording OpenGL QuartzCore QTKit QuickTime", false);
  539. if (isAU())
  540. s.addTokens ("AudioUnit CoreAudioKit AudioToolbox", false);
  541. else if (project.getJuceConfigFlag ("JUCE_PLUGINHOST_AU").toString() == Project::configFlagEnabled)
  542. s.addTokens ("AudioUnit CoreAudioKit", false);
  543. }
  544. for (int i = 0; i < s.size(); ++i)
  545. addFramework (s[i]);
  546. }
  547. //==============================================================================
  548. void writeProjectFile (OutputStream& output)
  549. {
  550. output << "// !$*UTF8*$!\n{\n"
  551. "\tarchiveVersion = 1;\n"
  552. "\tclasses = {\n\t};\n"
  553. "\tobjectVersion = 44;\n"
  554. "\tobjects = {\n\n";
  555. Array <ValueTree*> objects;
  556. objects.addArray (pbxBuildFiles);
  557. objects.addArray (pbxFileReferences);
  558. objects.addArray (groups);
  559. objects.addArray (targetConfigs);
  560. objects.addArray (projectConfigs);
  561. objects.addArray (misc);
  562. for (int i = 0; i < objects.size(); ++i)
  563. {
  564. ValueTree& o = *objects.getUnchecked(i);
  565. output << "\t\t" << static_cast <const juce_wchar*> (o.getType()) << " = { ";
  566. for (int j = 0; j < o.getNumProperties(); ++j)
  567. {
  568. const Identifier propertyName (o.getPropertyName(j));
  569. String val (o.getProperty (propertyName).toString());
  570. if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,-\r\n")
  571. && ! (val.trimStart().startsWithChar ('(')
  572. || val.trimStart().startsWithChar ('{'))))
  573. val = val.quoted();
  574. output << propertyName.toString() << " = " << val << "; ";
  575. }
  576. output << "};\n";
  577. }
  578. output << "\t};\n\trootObject = " << createID ("__root") << ";\n}\n";
  579. }
  580. static void addPlistDictionaryKey (XmlElement* xml, const String& key, const String& value)
  581. {
  582. xml->createNewChildElement ("key")->addTextElement (key);
  583. xml->createNewChildElement ("string")->addTextElement (value);
  584. }
  585. const String addBuildFile (const RelativePath& path, const String& fileRefID, bool addToSourceBuildPhase, bool inhibitWarnings)
  586. {
  587. String fileID (createID (path.toUnixStyle() + "buildref"));
  588. if (addToSourceBuildPhase)
  589. sourceIDs.add (fileID);
  590. ValueTree* v = new ValueTree (fileID);
  591. v->setProperty ("isa", "PBXBuildFile", 0);
  592. v->setProperty ("fileRef", fileRefID, 0);
  593. if (inhibitWarnings)
  594. v->setProperty ("settings", "{COMPILER_FLAGS = \"-w\"; }", 0);
  595. pbxBuildFiles.add (v);
  596. return fileID;
  597. }
  598. const String addBuildFile (const RelativePath& path, bool addToSourceBuildPhase, bool inhibitWarnings)
  599. {
  600. return addBuildFile (path, createID (path), addToSourceBuildPhase, inhibitWarnings);
  601. }
  602. void addFileReference (const RelativePath& path, const String& sourceTree, const String& lastKnownFileType, const String& fileRefID)
  603. {
  604. ValueTree* v = new ValueTree (fileRefID);
  605. v->setProperty ("isa", "PBXFileReference", 0);
  606. v->setProperty ("lastKnownFileType", lastKnownFileType, 0);
  607. v->setProperty (Ids::name, path.getFileName(), 0);
  608. v->setProperty ("path", sanitisePath (path.toUnixStyle()), 0);
  609. v->setProperty ("sourceTree", sourceTree, 0);
  610. pbxFileReferences.add (v);
  611. }
  612. const String addFileReference (const RelativePath& path)
  613. {
  614. const String fileRefID (createID (path));
  615. jassert (path.isAbsolute() || path.getRoot() == RelativePath::buildTargetFolder);
  616. addFileReference (path, path.isAbsolute() ? "<absolute>" : "SOURCE_ROOT",
  617. getFileType (path), fileRefID);
  618. return fileRefID;
  619. }
  620. static const String getFileType (const RelativePath& file)
  621. {
  622. if (file.hasFileExtension ("cpp;cc;cxx")) return "sourcecode.cpp.cpp";
  623. else if (file.hasFileExtension (".mm")) return "sourcecode.cpp.objcpp";
  624. else if (file.hasFileExtension (".m")) return "sourcecode.c.objc";
  625. else if (file.hasFileExtension (headerFileExtensions)) return "sourcecode.c.h";
  626. else if (file.hasFileExtension (".framework")) return "wrapper.framework";
  627. else if (file.hasFileExtension (".jpeg;.jpg")) return "image.jpeg";
  628. else if (file.hasFileExtension ("png;gif")) return "image" + file.getFileExtension();
  629. else if (file.hasFileExtension ("html;htm")) return "text.html";
  630. else if (file.hasFileExtension ("txt;rtf")) return "text" + file.getFileExtension();
  631. else if (file.hasFileExtension ("plist")) return "text.plist.xml";
  632. else if (file.hasFileExtension ("app")) return "wrapper.application";
  633. else if (file.hasFileExtension ("component;vst;plugin")) return "wrapper.cfbundle";
  634. else if (file.hasFileExtension ("xcodeproj")) return "wrapper.pb-project";
  635. else if (file.hasFileExtension ("a")) return "archive.ar";
  636. return "file" + file.getFileExtension();
  637. }
  638. const String addFile (const RelativePath& path, bool shouldBeCompiled, bool inhibitWarnings)
  639. {
  640. if (shouldBeCompiled)
  641. addBuildFile (path, true, inhibitWarnings);
  642. else if (path.hasFileExtension (".r"))
  643. rezFileIDs.add (addBuildFile (path, false, inhibitWarnings));
  644. return addFileReference (path);
  645. }
  646. const String addProjectItem (const Project::Item& projectItem)
  647. {
  648. if (projectItem.isGroup())
  649. {
  650. StringArray childIDs;
  651. for (int i = 0; i < projectItem.getNumChildren(); ++i)
  652. {
  653. const String childID (addProjectItem (projectItem.getChild(i)));
  654. if (childID.isNotEmpty())
  655. childIDs.add (childID);
  656. }
  657. return addGroup (projectItem, childIDs);
  658. }
  659. else
  660. {
  661. if (projectItem.shouldBeAddedToTargetProject())
  662. {
  663. const RelativePath path (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder);
  664. return addFile (path, projectItem.shouldBeCompiled(), false);
  665. }
  666. }
  667. return String::empty;
  668. }
  669. void addFramework (const String& frameworkName)
  670. {
  671. const RelativePath path ("System/Library/Frameworks/" + frameworkName + ".framework", RelativePath::unknown);
  672. const String fileRefID (createID (path));
  673. addFileReference (path, "SDKROOT", getFileType (path), fileRefID);
  674. frameworkIDs.add (addBuildFile (path, fileRefID, false, false));
  675. frameworkFileIDs.add (fileRefID);
  676. }
  677. void addGroup (const String& groupID, const String& groupName, const StringArray& childIDs)
  678. {
  679. ValueTree* v = new ValueTree (groupID);
  680. v->setProperty ("isa", "PBXGroup", 0);
  681. v->setProperty ("children", "(" + indentList (childIDs, ",") + " )", 0);
  682. v->setProperty (Ids::name, groupName, 0);
  683. v->setProperty ("sourceTree", "<group>", 0);
  684. groups.add (v);
  685. }
  686. const String createGroup (const Array<RelativePath>& files, const String& groupName, const String& groupIDName, bool inhibitWarnings)
  687. {
  688. StringArray fileIDs;
  689. for (int i = 0; i < files.size(); ++i)
  690. {
  691. addFile (files.getReference(i), shouldFileBeCompiledByDefault (files.getReference(i)), inhibitWarnings);
  692. fileIDs.add (createID (files.getReference(i)));
  693. }
  694. const String groupID (createID (groupIDName));
  695. addGroup (groupID, groupName, fileIDs);
  696. return groupID;
  697. }
  698. const String addGroup (const Project::Item& item, StringArray& childIDs)
  699. {
  700. String groupName (item.getName().toString());
  701. if (item.isMainGroup())
  702. {
  703. groupName = "Source";
  704. // Add 'Juce Library Code' group
  705. if (juceWrapperFiles.size() > 0)
  706. childIDs.add (createGroup (juceWrapperFiles, project.getJuceCodeGroupName(), "__jucelibfiles", false));
  707. if (isVST())
  708. childIDs.add (createGroup (getVSTFilesRequired(), "Juce VST Wrapper", "__jucevstfiles", false));
  709. if (isAU())
  710. childIDs.add (createAUWrappersGroup());
  711. if (isRTAS())
  712. childIDs.add (createGroup (getRTASFilesRequired(), "Juce RTAS Wrapper", "__jucertasfiles", true));
  713. { // Add 'resources' group
  714. String resourcesGroupID (createID ("__resources"));
  715. addGroup (resourcesGroupID, "Resources", resourceFileRefs);
  716. childIDs.add (resourcesGroupID);
  717. }
  718. { // Add 'frameworks' group
  719. String frameworksGroupID (createID ("__frameworks"));
  720. addGroup (frameworksGroupID, "Frameworks", frameworkFileIDs);
  721. childIDs.add (frameworksGroupID);
  722. }
  723. { // Add 'products' group
  724. String productsGroupID (createID ("__products"));
  725. StringArray products;
  726. products.add (createID ("__productFileID"));
  727. addGroup (productsGroupID, "Products", products);
  728. childIDs.add (productsGroupID);
  729. }
  730. }
  731. String groupID (getIDForGroup (item));
  732. addGroup (groupID, groupName, childIDs);
  733. return groupID;
  734. }
  735. void addBuildProduct (const String& fileType, const String& binaryName)
  736. {
  737. ValueTree* v = new ValueTree (createID ("__productFileID"));
  738. v->setProperty ("isa", "PBXFileReference", 0);
  739. v->setProperty ("explicitFileType", fileType, 0);
  740. v->setProperty ("includeInIndex", (int) 0, 0);
  741. v->setProperty ("path", sanitisePath (binaryName), 0);
  742. v->setProperty ("sourceTree", "BUILT_PRODUCTS_DIR", 0);
  743. pbxFileReferences.add (v);
  744. }
  745. void addTargetConfig (const String& configName, const StringArray& buildSettings)
  746. {
  747. ValueTree* v = new ValueTree (createID ("targetconfigid_" + configName));
  748. v->setProperty ("isa", "XCBuildConfiguration", 0);
  749. v->setProperty ("buildSettings", "{" + indentList (buildSettings, ";") + " }", 0);
  750. v->setProperty (Ids::name, configName, 0);
  751. targetConfigs.add (v);
  752. }
  753. void addProjectConfig (const String& configName, const StringArray& buildSettings)
  754. {
  755. ValueTree* v = new ValueTree (createID ("projectconfigid_" + configName));
  756. v->setProperty ("isa", "XCBuildConfiguration", 0);
  757. v->setProperty ("buildSettings", "{" + indentList (buildSettings, ";") + " }", 0);
  758. v->setProperty (Ids::name, configName, 0);
  759. projectConfigs.add (v);
  760. }
  761. void addConfigList (const OwnedArray <ValueTree>& configsToUse, const String& listID)
  762. {
  763. StringArray configIDs;
  764. for (int i = 0; i < configsToUse.size(); ++i)
  765. configIDs.add (configsToUse[i]->getType().toString());
  766. ValueTree* v = new ValueTree (listID);
  767. v->setProperty ("isa", "XCConfigurationList", 0);
  768. v->setProperty ("buildConfigurations", "(" + indentList (configIDs, ",") + " )", 0);
  769. v->setProperty ("defaultConfigurationIsVisible", (int) 0, 0);
  770. if (configsToUse[0] != 0)
  771. v->setProperty ("defaultConfigurationName", configsToUse[0]->getProperty (Ids::name), 0);
  772. misc.add (v);
  773. }
  774. ValueTree* addBuildPhase (const String& phaseType, const StringArray& fileIds)
  775. {
  776. String phaseId (createID (phaseType + "resbuildphase"));
  777. buildPhaseIDs.add (phaseId);
  778. ValueTree* v = new ValueTree (phaseId);
  779. v->setProperty ("isa", phaseType, 0);
  780. v->setProperty ("buildActionMask", "2147483647", 0);
  781. v->setProperty ("files", "(" + indentList (fileIds, ",") + " )", 0);
  782. v->setProperty ("runOnlyForDeploymentPostprocessing", (int) 0, 0);
  783. misc.add (v);
  784. return v;
  785. }
  786. void addTargetObject()
  787. {
  788. ValueTree* v = new ValueTree (createID ("__target"));
  789. v->setProperty ("isa", "PBXNativeTarget", 0);
  790. v->setProperty ("buildConfigurationList", createID ("__configList"), 0);
  791. v->setProperty ("buildPhases", "(" + indentList (buildPhaseIDs, ",") + " )", 0);
  792. v->setProperty ("buildRules", "( )", 0);
  793. v->setProperty ("dependencies", "( )", 0);
  794. v->setProperty (Ids::name, project.getDocumentTitle(), 0);
  795. v->setProperty ("productName", project.getDocumentTitle(), 0);
  796. v->setProperty ("productReference", createID ("__productFileID"), 0);
  797. if (project.isGUIApplication())
  798. {
  799. v->setProperty ("productInstallPath", "$(HOME)/Applications", 0);
  800. v->setProperty ("productType", "com.apple.product-type.application", 0);
  801. }
  802. else if (project.isCommandLineApp())
  803. {
  804. v->setProperty ("productInstallPath", "/usr/bin", 0);
  805. v->setProperty ("productType", "com.apple.product-type.tool", 0);
  806. }
  807. else if (project.isAudioPlugin() || project.isBrowserPlugin())
  808. {
  809. v->setProperty ("productInstallPath", "$(HOME)/Library/Audio/Plug-Ins/Components/", 0);
  810. v->setProperty ("productType", "com.apple.product-type.bundle", 0);
  811. }
  812. else if (project.isLibrary())
  813. {
  814. v->setProperty ("productType", "com.apple.product-type.library.static", 0);
  815. }
  816. else
  817. jassertfalse; //xxx
  818. misc.add (v);
  819. }
  820. void addProjectObject()
  821. {
  822. ValueTree* v = new ValueTree (createID ("__root"));
  823. v->setProperty ("isa", "PBXProject", 0);
  824. v->setProperty ("buildConfigurationList", createID ("__projList"), 0);
  825. v->setProperty ("compatibilityVersion", "Xcode 3.0", 0);
  826. v->setProperty ("hasScannedForEncodings", (int) 0, 0);
  827. v->setProperty ("mainGroup", getIDForGroup (project.getMainGroup()), 0);
  828. v->setProperty ("projectDirPath", "\"\"", 0);
  829. v->setProperty ("projectRoot", "\"\"", 0);
  830. v->setProperty ("targets", "( " + createID ("__target") + " )", 0);
  831. misc.add (v);
  832. }
  833. void addPluginShellScriptPhase()
  834. {
  835. ValueTree* v = addBuildPhase ("PBXShellScriptBuildPhase", StringArray());
  836. v->setProperty (Ids::name, "Copy to the different plugin folders", 0);
  837. v->setProperty ("shellPath", "/bin/sh", 0);
  838. v->setProperty ("shellScript", String::fromUTF8 (BinaryData::AudioPluginXCodeScript_txt, BinaryData::AudioPluginXCodeScript_txtSize)
  839. .replace ("\\", "\\\\")
  840. .replace ("\"", "\\\"")
  841. .replace ("\r\n", "\\n")
  842. .replace ("\n", "\\n"), 0);
  843. }
  844. //==============================================================================
  845. static const String indentList (const StringArray& list, const String& separator)
  846. {
  847. if (list.size() == 0)
  848. return " ";
  849. return "\n\t\t\t\t" + list.joinIntoString (separator + "\n\t\t\t\t")
  850. + (separator == ";" ? separator : String::empty);
  851. }
  852. const String createID (const RelativePath& path) const
  853. {
  854. return createID (path.toUnixStyle());
  855. }
  856. const String createID (const String& rootString) const
  857. {
  858. static const char digits[] = "0123456789ABCDEF";
  859. char n[24];
  860. Random ran (projectIDSalt + hashCode64 (rootString));
  861. for (int i = 0; i < numElementsInArray (n); ++i)
  862. n[i] = digits [ran.nextInt (16)];
  863. return String (n, numElementsInArray (n));
  864. }
  865. const String getIDForGroup (const Project::Item& item) const
  866. {
  867. return createID (item.getID());
  868. }
  869. bool shouldFileBeCompiledByDefault (const RelativePath& file) const
  870. {
  871. return file.hasFileExtension (sourceFileExtensions);
  872. }
  873. //==============================================================================
  874. const Array<RelativePath> getRTASFilesRequired() const
  875. {
  876. Array<RelativePath> s;
  877. if (isRTAS())
  878. {
  879. const char* files[] = { "extras/audio plugins/wrapper/RTAS/juce_RTAS_DigiCode1.cpp",
  880. "extras/audio plugins/wrapper/RTAS/juce_RTAS_DigiCode2.cpp",
  881. "extras/audio plugins/wrapper/RTAS/juce_RTAS_DigiCode3.cpp",
  882. "extras/audio plugins/wrapper/RTAS/juce_RTAS_DigiCode_Header.h",
  883. "extras/audio plugins/wrapper/RTAS/juce_RTAS_MacResources.r",
  884. "extras/audio plugins/wrapper/RTAS/juce_RTAS_MacUtilities.mm",
  885. "extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp" };
  886. for (int i = 0; i < numElementsInArray (files); ++i)
  887. s.add (getJucePathFromTargetFolder().getChildFile (files[i]));
  888. }
  889. return s;
  890. }
  891. const String createAUWrappersGroup()
  892. {
  893. Array<RelativePath> auWrappers;
  894. const char* files[] = { "extras/audio plugins/wrapper/AU/juce_AU_Resources.r",
  895. "extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm" };
  896. int i;
  897. for (i = 0; i < numElementsInArray (files); ++i)
  898. auWrappers.add (getJucePathFromTargetFolder().getChildFile (files[i]));
  899. const char* appleAUFiles[] = { "Extras/CoreAudio/PublicUtility/CADebugMacros.h",
  900. "Extras/CoreAudio/PublicUtility/CAAUParameter.cpp",
  901. "Extras/CoreAudio/PublicUtility/CAAUParameter.h",
  902. "Extras/CoreAudio/PublicUtility/CAAudioChannelLayout.cpp",
  903. "Extras/CoreAudio/PublicUtility/CAAudioChannelLayout.h",
  904. "Extras/CoreAudio/PublicUtility/CAMutex.cpp",
  905. "Extras/CoreAudio/PublicUtility/CAMutex.h",
  906. "Extras/CoreAudio/PublicUtility/CAStreamBasicDescription.cpp",
  907. "Extras/CoreAudio/PublicUtility/CAStreamBasicDescription.h",
  908. "Extras/CoreAudio/PublicUtility/CAVectorUnitTypes.h",
  909. "Extras/CoreAudio/PublicUtility/CAVectorUnit.cpp",
  910. "Extras/CoreAudio/PublicUtility/CAVectorUnit.h",
  911. "Extras/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h",
  912. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp",
  913. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp",
  914. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h",
  915. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp",
  916. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h",
  917. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp",
  918. "Extras/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h",
  919. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp",
  920. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h",
  921. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp",
  922. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h",
  923. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp",
  924. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h",
  925. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp",
  926. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h",
  927. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUResources.r",
  928. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp",
  929. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h",
  930. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp",
  931. "Extras/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h",
  932. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp",
  933. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h",
  934. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp",
  935. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h",
  936. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.cpp",
  937. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUOutputBase.h",
  938. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp",
  939. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h",
  940. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp",
  941. "Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h",
  942. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp",
  943. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h",
  944. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUDebugDispatcher.cpp",
  945. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUDebugDispatcher.h",
  946. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h",
  947. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h",
  948. "Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h" };
  949. StringArray fileIDs, appleFileIDs;
  950. for (i = 0; i < auWrappers.size(); ++i)
  951. {
  952. addFile (auWrappers.getReference(i), shouldFileBeCompiledByDefault (auWrappers.getReference(i)), false);
  953. fileIDs.add (createID (auWrappers.getReference(i)));
  954. }
  955. for (i = 0; i < numElementsInArray (appleAUFiles); ++i)
  956. {
  957. RelativePath file (appleAUFiles[i], RelativePath::unknown);
  958. const String fileRefID (createID (file));
  959. addFileReference (file, "DEVELOPER_DIR", getFileType (file), fileRefID);
  960. if (shouldFileBeCompiledByDefault (file))
  961. addBuildFile (file, fileRefID, true, true);
  962. appleFileIDs.add (fileRefID);
  963. }
  964. const String appleGroupID (createID ("__juceappleaufiles"));
  965. addGroup (appleGroupID, "Apple AU Files", appleFileIDs);
  966. fileIDs.add (appleGroupID);
  967. const String groupID (createID ("__juceaufiles"));
  968. addGroup (groupID, "Juce AU Wrapper", fileIDs);
  969. return groupID;
  970. }
  971. };
  972. #endif // __JUCER_PROJECTEXPORT_XCODE_JUCEHEADER__