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.

1213 lines
54KB

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