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.

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