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.

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