diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 23c3b48d6f..b755abffc1 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -2204,20 +2204,23 @@ private: return refID; } - String addRezFile (const RelativePath& path) const + String addRezFile (const Project::Item& projectItem, const RelativePath& path) const { const String pathAsString (path.toUnixStyle()); const String refID (addFileReference (path.toUnixStyle())); - Target* auTarget = getTargetOfType (Target::AudioUnitPlugIn); - - if (auTarget == nullptr) - return String(); + if (projectItem.isModuleCode()) + { + if (Target* xcodeTarget = getTargetOfType (getTargetTypeFromFilePath (projectItem.getFile(), false))) + { + String rezFileID = addBuildFile (pathAsString, refID, false, false, xcodeTarget); + xcodeTarget->rezFileIDs.add (rezFileID); - String rezFileID = addBuildFile (pathAsString, refID, false, false, auTarget); - auTarget->rezFileIDs.add (rezFileID); + return refID; + } + } - return refID; + return String(); } String getEntitlementsFileName() const @@ -2270,25 +2273,12 @@ private: else path = RelativePath (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder); - if (path.hasFileExtension (".r") && LibraryModule::CompileUnit::hasSuffix (projectItem.getFile(), "_AU")) - return addRezFile (path); + if (path.hasFileExtension (".r")) + return addRezFile (projectItem, path); Target* xcodeTarget = nullptr; if (projectItem.isModuleCode() && projectItem.shouldBeCompiled()) - { - const File& file = projectItem.getFile(); - - Target::Type targetType = Target::unspecified; - if (LibraryModule::CompileUnit::hasSuffix (file, "_AU")) targetType = Target::AudioUnitPlugIn; - else if (LibraryModule::CompileUnit::hasSuffix (file, "_AUv3")) targetType = Target::AudioUnitv3PlugIn; - else if (LibraryModule::CompileUnit::hasSuffix (file, "_AAX")) targetType = Target::AAXPlugIn; - else if (LibraryModule::CompileUnit::hasSuffix (file, "_RTAS")) targetType = Target::RTASPlugIn; - else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST2")) targetType = Target::VSTPlugIn; - else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST3")) targetType = Target::VST3PlugIn; - else if (LibraryModule::CompileUnit::hasSuffix (file, "_Standalone")) targetType = Target::StandalonePlugIn; - - xcodeTarget = getTargetOfType (targetType); - } + xcodeTarget = getTargetOfType (getTargetTypeFromFilePath (projectItem.getFile(), false)); return addFile (path, projectItem.shouldBeCompiled(), projectItem.shouldBeAddedToBinaryResources(), @@ -2392,6 +2382,19 @@ private: misc.add (v); } + static Target::Type getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffic) + { + if (LibraryModule::CompileUnit::hasSuffix (file, "_AU")) return Target::AudioUnitPlugIn; + else if (LibraryModule::CompileUnit::hasSuffix (file, "_AUv3")) return Target::AudioUnitv3PlugIn; + else if (LibraryModule::CompileUnit::hasSuffix (file, "_AAX")) return Target::AAXPlugIn; + else if (LibraryModule::CompileUnit::hasSuffix (file, "_RTAS")) return Target::RTASPlugIn; + else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST2")) return Target::VSTPlugIn; + else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST3")) return Target::VST3PlugIn; + else if (LibraryModule::CompileUnit::hasSuffix (file, "_Standalone")) return Target::StandalonePlugIn; + + return (returnSharedTargetIfNoValidSuffic ? Target::SharedCodeTarget : Target::unspecified); + } + //============================================================================== void removeMismatchedXcuserdata() const { diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp index e25b071dbb..de39d82714 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -46,8 +46,6 @@ #pragma clang diagnostic ignored "-Wcomment" #endif -JUCE_DEFINE_WRAPPER_TYPE (wrapperType_RTAS); - /* Note about include paths ------------------------ @@ -107,6 +105,8 @@ JUCE_DEFINE_WRAPPER_TYPE (wrapperType_RTAS); #include "../utility/juce_IncludeModuleHeaders.h" +JUCE_DEFINE_WRAPPER_TYPE (wrapperType_RTAS); + #ifdef _MSC_VER #pragma pack (pop) diff --git a/modules/juce_audio_plugin_client/AU/juce_RezResources_AU.r b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU.r similarity index 100% rename from modules/juce_audio_plugin_client/AU/juce_RezResources_AU.r rename to modules/juce_audio_plugin_client/juce_audio_plugin_client_AU.r diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_RTAS.r b/modules/juce_audio_plugin_client/juce_audio_plugin_client_RTAS.r new file mode 100644 index 0000000000..a40e1f397e --- /dev/null +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_RTAS.r @@ -0,0 +1,6 @@ + +/* + This dummy file is added to the resources section of the project to + force XCode to create some resources for the dpm. If there aren't any + resources, PT will refuse to load the plugin.. +*/