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.

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