|
|
@@ -1187,31 +1187,24 @@ bool Project::shouldBuildTargetType (build_tools::ProjectType::Target::Type targ |
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool hasParentDirectory (File f, StringRef parentName)
|
|
|
|
build_tools::ProjectType::Target::Type Project::getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffix)
|
|
|
|
{
|
|
|
|
for (int depth = 0; depth < 2; ++depth)
|
|
|
|
auto isInPluginClientSubdir = [file] (StringRef subDir)
|
|
|
|
{
|
|
|
|
auto parent = f.getParentDirectory();
|
|
|
|
|
|
|
|
if (parent.getFileName() == parentName)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
f = parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return file.getFullPathName().contains ("juce_audio_plugin_client"
|
|
|
|
+ File::getSeparatorString()
|
|
|
|
+ subDir
|
|
|
|
+ File::getSeparatorString());
|
|
|
|
};
|
|
|
|
|
|
|
|
build_tools::ProjectType::Target::Type Project::getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffix)
|
|
|
|
{
|
|
|
|
if (LibraryModule::CompileUnit::hasSuffix (file, "_AU") || hasParentDirectory (file, "AU")) return build_tools::ProjectType::Target::AudioUnitPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_AUv3") || hasParentDirectory (file, "AU")) return build_tools::ProjectType::Target::AudioUnitv3PlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_AAX") || hasParentDirectory (file, "AAX")) return build_tools::ProjectType::Target::AAXPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_RTAS") || hasParentDirectory (file, "RTAS")) return build_tools::ProjectType::Target::RTASPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST2") || hasParentDirectory (file, "VST")) return build_tools::ProjectType::Target::VSTPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST3") || hasParentDirectory (file, "VST3")) return build_tools::ProjectType::Target::VST3PlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_Standalone") || hasParentDirectory (file, "Standalone")) return build_tools::ProjectType::Target::StandalonePlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_Unity") || hasParentDirectory (file, "Unity")) return build_tools::ProjectType::Target::UnityPlugIn;
|
|
|
|
if (LibraryModule::CompileUnit::hasSuffix (file, "_AU") || isInPluginClientSubdir ("AU")) return build_tools::ProjectType::Target::AudioUnitPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_AUv3") || isInPluginClientSubdir ("AU")) return build_tools::ProjectType::Target::AudioUnitv3PlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_AAX") || isInPluginClientSubdir ("AAX")) return build_tools::ProjectType::Target::AAXPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_RTAS") || isInPluginClientSubdir ("RTAS")) return build_tools::ProjectType::Target::RTASPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST2") || isInPluginClientSubdir ("VST")) return build_tools::ProjectType::Target::VSTPlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_VST3") || isInPluginClientSubdir ("VST3")) return build_tools::ProjectType::Target::VST3PlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_Standalone") || isInPluginClientSubdir ("Standalone")) return build_tools::ProjectType::Target::StandalonePlugIn;
|
|
|
|
else if (LibraryModule::CompileUnit::hasSuffix (file, "_Unity") || isInPluginClientSubdir ("Unity")) return build_tools::ProjectType::Target::UnityPlugIn;
|
|
|
|
|
|
|
|
return (returnSharedTargetIfNoValidSuffix ? build_tools::ProjectType::Target::SharedCodeTarget : build_tools::ProjectType::Target::unspecified);
|
|
|
|
}
|
|
|
|