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.

1215 lines
53KB

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