diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index 39cfce65ac..457058e052 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -1920,13 +1920,13 @@ EnabledModuleList& Project::getEnabledModules() return *enabledModuleList; } -static Array getModulePathsFromCompatibleExporters (Project& project) +static StringArray getModulePathsFromExporters (Project& project, bool onlyThisOS) { StringArray paths; for (Project::ExporterIterator exporter (project); exporter.next();) { - if (! exporter->mayCompileOnCurrentOS()) + if (onlyThisOS && ! exporter->mayCompileOnCurrentOS()) continue; auto& modules = project.getEnabledModules(); @@ -1951,9 +1951,19 @@ static Array getModulePathsFromCompatibleExporters (Project& project) paths.addIfNotAlreadyThere (oldPath); } + return paths; +} + +static Array getExporterModulePathsToScan (Project& project) +{ + auto exporterPaths = getModulePathsFromExporters (project, true); + + if (exporterPaths.isEmpty()) + exporterPaths = getModulePathsFromExporters (project, false); + Array files; - for (auto& path : paths) + for (auto& path : exporterPaths) { auto f = project.resolveFilename (path); @@ -1977,9 +1987,9 @@ AvailableModuleList& Project::getExporterPathsModuleList() void Project::rescanExporterPathModules (bool async) { if (async) - exporterPathsModuleList->scanPathsAsync (getModulePathsFromCompatibleExporters (*this)); + exporterPathsModuleList->scanPathsAsync (getExporterModulePathsToScan (*this)); else - exporterPathsModuleList->scanPaths (getModulePathsFromCompatibleExporters (*this)); + exporterPathsModuleList->scanPaths (getExporterModulePathsToScan (*this)); } ModuleIDAndFolder Project::getModuleWithID (const String& id)