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.

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