mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
refactoring: put initialisation of dependency path values into the individual exporters, called from their constructors.
This commit is contained in:
parent
7ea0ab19fd
commit
a178731a95
7 changed files with 126 additions and 23 deletions
|
|
@ -64,17 +64,7 @@ public:
|
|||
if (getKeyAliasPassValue().getValue().isVoid()) getKeyAliasPassValue() = "android";
|
||||
if (getCPP11EnabledValue().getValue().isVoid()) getCPP11EnabledValue() = true;
|
||||
|
||||
sdkPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::androidSDKPath),
|
||||
DependencyPath::androidSdkKeyName,
|
||||
DependencyPath::getThisOS()
|
||||
));
|
||||
|
||||
ndkPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::androidNDKPath),
|
||||
DependencyPath::androidNdkKeyName,
|
||||
DependencyPath::getThisOS()
|
||||
));
|
||||
initialiseDependencyPathValues();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -761,6 +751,21 @@ private:
|
|||
writeXmlOrThrow (strings, file, "utf-8", 100);
|
||||
}
|
||||
|
||||
void initialiseDependencyPathValues()
|
||||
{
|
||||
sdkPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::androidSDKPath),
|
||||
DependencyPath::androidSdkKeyName,
|
||||
DependencyPath::getThisOS()
|
||||
));
|
||||
|
||||
ndkPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::androidNDKPath),
|
||||
DependencyPath::androidNdkKeyName,
|
||||
DependencyPath::getThisOS()
|
||||
));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Value sdkPath, ndkPath;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ public:
|
|||
|
||||
if (getTargetLocationString().isEmpty())
|
||||
getTargetLocationValue() = getDefaultBuildsRootFolder() + getTargetFolderName (os);
|
||||
|
||||
initialiseDependencyPathValues();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -401,6 +403,38 @@ private:
|
|||
xml.createNewChildElement ("Add")->setAttribute (nm, value);
|
||||
}
|
||||
|
||||
void initialiseDependencyPathValues()
|
||||
{
|
||||
DependencyPathOS pathOS = isLinux() ? DependencyPathOS::linux : DependencyPathOS::windows;
|
||||
|
||||
vst2Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vstFolder),
|
||||
DependencyPath::vst2KeyName,
|
||||
pathOS
|
||||
));
|
||||
|
||||
vst3Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vst3Folder),
|
||||
DependencyPath::vst3KeyName,
|
||||
pathOS
|
||||
));
|
||||
|
||||
if (! isLinux())
|
||||
{
|
||||
aaxPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::aaxFolder),
|
||||
DependencyPath::aaxKeyName,
|
||||
pathOS
|
||||
));
|
||||
|
||||
rtasPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::rtasFolder),
|
||||
DependencyPath::rtasKeyName,
|
||||
pathOS
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
CodeBlocksOS os;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (CodeBlocksProjectExporter)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ public:
|
|||
|
||||
projectGUID = createGUID (project.getProjectUID());
|
||||
updateOldSettings();
|
||||
|
||||
initialiseDependencyPathValues();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -555,6 +557,33 @@ protected:
|
|||
: (".\\" + filename);
|
||||
}
|
||||
|
||||
void initialiseDependencyPathValues()
|
||||
{
|
||||
vst2Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vstFolder),
|
||||
DependencyPath::vst2KeyName,
|
||||
DependencyPathOS::windows
|
||||
));
|
||||
|
||||
vst3Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vst3Folder),
|
||||
DependencyPath::vst3KeyName,
|
||||
DependencyPathOS::windows
|
||||
));
|
||||
|
||||
aaxPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::aaxFolder),
|
||||
DependencyPath::aaxKeyName,
|
||||
DependencyPathOS::windows
|
||||
));
|
||||
|
||||
rtasPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::rtasFolder),
|
||||
DependencyPath::rtasKeyName,
|
||||
DependencyPathOS::windows
|
||||
));
|
||||
}
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterBase)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ public:
|
|||
|
||||
if (getTargetLocationString().isEmpty())
|
||||
getTargetLocationValue() = getDefaultBuildsRootFolder() + "LinuxMakefile";
|
||||
|
||||
initialiseDependencyPathValues();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -346,5 +348,20 @@ private:
|
|||
+ "_" + String::toHexString (file.toUnixStyle().hashCode()) + ".o";
|
||||
}
|
||||
|
||||
void initialiseDependencyPathValues()
|
||||
{
|
||||
vst2Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vstFolder),
|
||||
DependencyPath::vst2KeyName,
|
||||
DependencyPathOS::linux
|
||||
));
|
||||
|
||||
vst3Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vst3Folder),
|
||||
DependencyPath::vst3KeyName,
|
||||
DependencyPathOS::linux
|
||||
));
|
||||
}
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (MakefileProjectExporter)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public:
|
|||
|
||||
if (getTargetLocationString().isEmpty())
|
||||
getTargetLocationValue() = getDefaultBuildsRootFolder() + (iOS ? "iOS" : "MacOSX");
|
||||
|
||||
initialiseDependencyPathValues();
|
||||
}
|
||||
|
||||
static XCodeProjectExporter* createForSettings (Project& project, const ValueTree& settings)
|
||||
|
|
@ -1499,4 +1501,31 @@ private:
|
|||
jassert (version >= 4);
|
||||
return "10." + String (version) + " SDK";
|
||||
}
|
||||
|
||||
void initialiseDependencyPathValues()
|
||||
{
|
||||
vst2Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vstFolder),
|
||||
DependencyPath::vst2KeyName,
|
||||
DependencyPathOS::osx
|
||||
));
|
||||
|
||||
vst3Path = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::vst3Folder),
|
||||
DependencyPath::vst3KeyName,
|
||||
DependencyPathOS::osx
|
||||
));
|
||||
|
||||
aaxPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::aaxFolder),
|
||||
DependencyPath::aaxKeyName,
|
||||
DependencyPathOS::osx
|
||||
));
|
||||
|
||||
rtasPath = Value (new DependencyPathValueSource (
|
||||
getSetting (Ids::rtasFolder),
|
||||
DependencyPath::rtasKeyName,
|
||||
DependencyPathOS::osx
|
||||
));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -223,17 +223,6 @@ namespace
|
|||
exporter.rebaseFromProjectFolderToBuildTarget (path)
|
||||
.toWindowsStyle());
|
||||
}
|
||||
|
||||
DependencyPathOS getDependencyPathOS (const ProjectExporter& exporter)
|
||||
{
|
||||
if (exporter.isWindows()) return DependencyPath::windows;
|
||||
if (exporter.isXcode()) return DependencyPath::osx;
|
||||
if (exporter.isLinux()) return DependencyPath::linux;
|
||||
|
||||
// cannot figure out which OS's dependency paths this exporter wants!!
|
||||
jassertfalse;
|
||||
return DependencyPath::unknown;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class DependencyPathValueSource : public Value::ValueSource,
|
|||
public:
|
||||
DependencyPathValueSource (const Value& projectSettingsPath,
|
||||
String globalSettingsKey,
|
||||
DependencyPathOS osThisSettingAppliesTo = DependencyPath::getThisOS());
|
||||
DependencyPathOS osThisSettingAppliesTo);
|
||||
|
||||
/** This gets the currently used value, which may be either
|
||||
the project setting, the global setting, or the fallback value. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue