mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-30 02:50:05 +00:00
Introjucer: fixed a crash if you try to create an Android VST
This commit is contained in:
parent
3bc38d1e3b
commit
29058d4231
1 changed files with 54 additions and 43 deletions
|
|
@ -238,7 +238,12 @@ namespace
|
|||
//==============================================================================
|
||||
namespace VSTHelpers
|
||||
{
|
||||
static void addVSTFolderToPath (ProjectExporter& exporter, bool isVST3)
|
||||
inline bool isExporterSupported (ProjectExporter& exporter)
|
||||
{
|
||||
return ! exporter.isAndroid();
|
||||
}
|
||||
|
||||
inline void addVSTFolderToPath (ProjectExporter& exporter, bool isVST3)
|
||||
{
|
||||
const String vstFolder (exporter.getVSTPathValue (isVST3).toString());
|
||||
|
||||
|
|
@ -246,7 +251,7 @@ namespace VSTHelpers
|
|||
exporter.addToExtraSearchPaths (RelativePath (vstFolder, RelativePath::projectFolder), 0);
|
||||
}
|
||||
|
||||
static void createVSTPathEditor (ProjectExporter& exporter, PropertyListBuilder& props, bool isVST3)
|
||||
inline void createVSTPathEditor (ProjectExporter& exporter, PropertyListBuilder& props, bool isVST3)
|
||||
{
|
||||
const String vstFormat (isVST3 ? "VST3" : "VST");
|
||||
|
||||
|
|
@ -255,64 +260,70 @@ namespace VSTHelpers
|
|||
"If you're building a " + vstFormat + ", this must be the folder containing the " + vstFormat + " SDK. This should be an absolute path.");
|
||||
}
|
||||
|
||||
static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver, bool isVST3)
|
||||
inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver, bool isVST3)
|
||||
{
|
||||
fixMissingXcodePostBuildScript (exporter);
|
||||
writePluginCharacteristicsFile (projectSaver);
|
||||
|
||||
exporter.makefileTargetSuffix = ".so";
|
||||
|
||||
Project::Item group (Project::Item::createGroup (const_cast<ProjectExporter&> (exporter).getProject(),
|
||||
"Juce VST Wrapper", "__jucevstfiles"));
|
||||
|
||||
addVSTFolderToPath (exporter, isVST3);
|
||||
|
||||
if (exporter.isVisualStudio())
|
||||
if (isExporterSupported (exporter))
|
||||
{
|
||||
if (! exporter.getExtraLinkerFlagsString().contains ("/FORCE:multiple"))
|
||||
exporter.getExtraLinkerFlags() = exporter.getExtraLinkerFlags().toString() + " /FORCE:multiple";
|
||||
fixMissingXcodePostBuildScript (exporter);
|
||||
writePluginCharacteristicsFile (projectSaver);
|
||||
|
||||
RelativePath modulePath (exporter.rebaseFromProjectFolderToBuildTarget (RelativePath (exporter.getPathForModuleString ("juce_audio_plugin_client"),
|
||||
RelativePath::projectFolder)
|
||||
.getChildFile ("juce_audio_plugin_client")
|
||||
.getChildFile ("VST3")));
|
||||
exporter.makefileTargetSuffix = ".so";
|
||||
|
||||
for (ProjectExporter::ConfigIterator config (exporter); config.next();)
|
||||
Project::Item group (Project::Item::createGroup (const_cast<ProjectExporter&> (exporter).getProject(),
|
||||
"Juce VST Wrapper", "__jucevstfiles"));
|
||||
|
||||
addVSTFolderToPath (exporter, isVST3);
|
||||
|
||||
if (exporter.isVisualStudio())
|
||||
{
|
||||
if (config->getValue (Ids::useRuntimeLibDLL).getValue().isVoid())
|
||||
config->getValue (Ids::useRuntimeLibDLL) = true;
|
||||
if (! exporter.getExtraLinkerFlagsString().contains ("/FORCE:multiple"))
|
||||
exporter.getExtraLinkerFlags() = exporter.getExtraLinkerFlags().toString() + " /FORCE:multiple";
|
||||
|
||||
if (isVST3)
|
||||
if (config->getValue (Ids::postbuildCommand).toString().isEmpty())
|
||||
config->getValue (Ids::postbuildCommand) = "copy /Y \"$(OutDir)\\$(TargetFileName)\" \"$(OutDir)\\$(TargetName).vst3\"";
|
||||
RelativePath modulePath (exporter.rebaseFromProjectFolderToBuildTarget (RelativePath (exporter.getPathForModuleString ("juce_audio_plugin_client"),
|
||||
RelativePath::projectFolder)
|
||||
.getChildFile ("juce_audio_plugin_client")
|
||||
.getChildFile ("VST3")));
|
||||
|
||||
for (ProjectExporter::ConfigIterator config (exporter); config.next();)
|
||||
{
|
||||
if (config->getValue (Ids::useRuntimeLibDLL).getValue().isVoid())
|
||||
config->getValue (Ids::useRuntimeLibDLL) = true;
|
||||
|
||||
if (isVST3)
|
||||
if (config->getValue (Ids::postbuildCommand).toString().isEmpty())
|
||||
config->getValue (Ids::postbuildCommand) = "copy /Y \"$(OutDir)\\$(TargetFileName)\" \"$(OutDir)\\$(TargetName).vst3\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (exporter.isLinux())
|
||||
exporter.makefileExtraLinkerFlags.add ("-Wl,--no-undefined");
|
||||
if (exporter.isLinux())
|
||||
exporter.makefileExtraLinkerFlags.add ("-Wl,--no-undefined");
|
||||
}
|
||||
}
|
||||
|
||||
static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props, bool isVST3)
|
||||
inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props, bool isVST3)
|
||||
{
|
||||
fixMissingXcodePostBuildScript (exporter);
|
||||
createVSTPathEditor (exporter, props, isVST3);
|
||||
if (isExporterSupported (exporter))
|
||||
{
|
||||
fixMissingXcodePostBuildScript (exporter);
|
||||
createVSTPathEditor (exporter, props, isVST3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
namespace RTASHelpers
|
||||
{
|
||||
static RelativePath getRTASRelativeFolderPath (ProjectExporter& exporter)
|
||||
inline RelativePath getRTASRelativeFolderPath (ProjectExporter& exporter)
|
||||
{
|
||||
return RelativePath (exporter.getRTASPathValue().toString(), RelativePath::projectFolder);
|
||||
}
|
||||
|
||||
static bool isExporterSupported (ProjectExporter& exporter)
|
||||
inline bool isExporterSupported (ProjectExporter& exporter)
|
||||
{
|
||||
return exporter.isVisualStudio() || exporter.isXcode();
|
||||
}
|
||||
|
||||
static void addExtraSearchPaths (ProjectExporter& exporter)
|
||||
inline void addExtraSearchPaths (ProjectExporter& exporter)
|
||||
{
|
||||
RelativePath rtasFolder (getRTASRelativeFolderPath (exporter));
|
||||
|
||||
|
|
@ -393,7 +404,7 @@ namespace RTASHelpers
|
|||
}
|
||||
}
|
||||
|
||||
static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
|
||||
inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
|
||||
{
|
||||
if (isExporterSupported (exporter))
|
||||
{
|
||||
|
|
@ -448,7 +459,7 @@ namespace RTASHelpers
|
|||
}
|
||||
}
|
||||
|
||||
static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props)
|
||||
inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props)
|
||||
{
|
||||
if (isExporterSupported (exporter))
|
||||
{
|
||||
|
|
@ -464,7 +475,7 @@ namespace RTASHelpers
|
|||
//==============================================================================
|
||||
namespace AUHelpers
|
||||
{
|
||||
static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
|
||||
inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
|
||||
{
|
||||
writePluginCharacteristicsFile (projectSaver);
|
||||
|
||||
|
|
@ -500,17 +511,17 @@ namespace AUHelpers
|
|||
//==============================================================================
|
||||
namespace AAXHelpers
|
||||
{
|
||||
static RelativePath getAAXRelativeFolderPath (ProjectExporter& exporter)
|
||||
inline RelativePath getAAXRelativeFolderPath (ProjectExporter& exporter)
|
||||
{
|
||||
return RelativePath (exporter.getAAXPathValue().toString(), RelativePath::projectFolder);
|
||||
}
|
||||
|
||||
static bool isExporterSupported (ProjectExporter& exporter)
|
||||
inline bool isExporterSupported (ProjectExporter& exporter)
|
||||
{
|
||||
return exporter.isVisualStudio() || exporter.isXcode();
|
||||
}
|
||||
|
||||
static void addExtraSearchPaths (ProjectExporter& exporter)
|
||||
inline void addExtraSearchPaths (ProjectExporter& exporter)
|
||||
{
|
||||
const RelativePath aaxFolder (getAAXRelativeFolderPath (exporter));
|
||||
|
||||
|
|
@ -519,7 +530,7 @@ namespace AAXHelpers
|
|||
exporter.addToExtraSearchPaths (aaxFolder.getChildFile ("Interfaces").getChildFile ("ACF"));
|
||||
}
|
||||
|
||||
static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
|
||||
inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
|
||||
{
|
||||
if (isExporterSupported (exporter))
|
||||
{
|
||||
|
|
@ -548,7 +559,7 @@ namespace AAXHelpers
|
|||
}
|
||||
}
|
||||
|
||||
static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props)
|
||||
inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props)
|
||||
{
|
||||
if (isExporterSupported (exporter))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue