1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: Fixed live-build when app config is disabled

This commit is contained in:
ed 2020-05-19 16:27:22 +01:00
parent 71fa877454
commit 7ee2af23fc
5 changed files with 62 additions and 56 deletions

View file

@ -2425,6 +2425,49 @@ String Project::getFileTemplate (const String& templateName)
}
StringPairArray Project::getAppConfigDefs()
{
StringPairArray result;
result.set ("JUCE_DISPLAY_SPLASH_SCREEN", shouldDisplaySplashScreen() ? "1" : "0");
result.set ("JUCE_USE_DARK_SPLASH_SCREEN", getSplashScreenColourString() == "Dark" ? "1" : "0");
result.set ("JUCE_PROJUCER_VERSION", "0x" + String::toHexString (ProjectInfo::versionNumber));
OwnedArray<LibraryModule> modules;
getEnabledModules().createRequiredModules (modules);
for (auto& m : modules)
result.set ("JUCE_MODULE_AVAILABLE_" + m->getID(), "1");
result.set ("JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED", "1");
for (auto& m : modules)
{
OwnedArray<Project::ConfigFlag> flags;
m->getConfigFlags (*this, flags);
for (auto* flag : flags)
if (! flag->value.isUsingDefault())
result.set (flag->symbol, flag->value.get() ? "1" : "0");
}
result.addArray (getAudioPluginFlags());
const auto& type = getProjectType();
const auto isStandaloneApplication = (! type.isAudioPlugin() && ! type.isDynamicLibrary());
const auto standaloneValue = [&]
{
if (result.containsKey ("JucePlugin_Name") && result.containsKey ("JucePlugin_Build_Standalone"))
return "JucePlugin_Build_Standalone";
return isStandaloneApplication ? "1" : "0";
}();
result.set ("JUCE_STANDALONE_APPLICATION", standaloneValue);
return result;
}
StringPairArray Project::getAudioPluginFlags() const
{
if (! isAudioPluginProject())