Skip to content

Commit

Permalink
Projucer: Use exporter name, rather than build folder name, to locate…
Browse files Browse the repository at this point in the history
… pre-built libraries
  • Loading branch information
reuk committed Mar 24, 2021
1 parent 3f17cc7 commit 8c9c3c3
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 7 deletions.
16 changes: 9 additions & 7 deletions extras/Projucer/Source/Project/Modules/jucer_Modules.cpp
Expand Up @@ -61,14 +61,16 @@ void LibraryModule::addSearchPathsToExporter (ProjectExporter& exporter) const

exporter.addToExtraSearchPaths (moduleRelativePath.getParentDirectory());

String libDirPlatform;
const auto libDirPlatform = [&]() -> String
{
if (exporter.isLinux())
return "Linux";

if (exporter.isLinux())
libDirPlatform = "Linux";
else if (exporter.isCodeBlocks() && exporter.isWindows())
libDirPlatform = "MinGW";
else
libDirPlatform = exporter.getTargetFolder().getFileName();
if (exporter.isCodeBlocks() && exporter.isWindows())
return "MinGW";

return exporter.getTypeInfoForExporter (exporter.getExporterIdentifier()).targetFolder;
}();

auto libSubdirPath = moduleRelativePath.toUnixStyle() + "/libs/" + libDirPlatform;
auto moduleLibDir = File (exporter.getProject().getProjectFolder().getFullPathName() + "/" + libSubdirPath);
Expand Down
Expand Up @@ -76,6 +76,8 @@ class AndroidProjectExporter : public ProjectExporter
static String getValueTreeTypeName() { return "ANDROIDSTUDIO"; }
static String getTargetFolderName() { return "Android"; }

Identifier getExporterIdentifier() const override { return getValueTreeTypeName(); }

static const char* getDefaultActivityClass() { return "com.rmsl.juce.JuceActivity"; }
static const char* getDefaultApplicationClass() { return "com.rmsl.juce.JuceApp"; }

Expand Down
Expand Up @@ -57,6 +57,8 @@ class CLionProjectExporter : public ProjectExporter
static String getValueTreeTypeName() { return "CLION"; }
static String getTargetFolderName() { return "CLion"; }

Identifier getExporterIdentifier() const override { return getValueTreeTypeName(); }

static CLionProjectExporter* createForSettings (Project& projectToUse, const ValueTree& settingsToUse)
{
if (settingsToUse.hasType (getValueTreeTypeName()))
Expand Down
Expand Up @@ -98,6 +98,11 @@ class CodeBlocksProjectExporter : public ProjectExporter
bool isOSX() const override { return false; }
bool isiOS() const override { return false; }

Identifier getExporterIdentifier() const override
{
return isLinux() ? getValueTreeTypeNameLinux() : getValueTreeTypeNameWindows();
}

String getNewLineString() const override { return isWindows() ? "\r\n" : "\n"; }

bool supportsTargetType (build_tools::ProjectType::Target::Type type) const override
Expand Down
Expand Up @@ -1758,6 +1758,8 @@ class MSVCProjectExporterVC2015 : public MSVCProjectExporterBase
static String getValueTreeTypeName() { return "VS2015"; }
static String getTargetFolderName() { return "VisualStudio2015"; }

Identifier getExporterIdentifier() const override { return getValueTreeTypeName(); }

int getVisualStudioVersion() const override { return 14; }
String getSolutionComment() const override { return "# Visual Studio 2015"; }
String getToolsVersion() const override { return "14.0"; }
Expand Down Expand Up @@ -1801,6 +1803,8 @@ class MSVCProjectExporterVC2017 : public MSVCProjectExporterBase
static String getValueTreeTypeName() { return "VS2017"; }
static String getTargetFolderName() { return "VisualStudio2017"; }

Identifier getExporterIdentifier() const override { return getValueTreeTypeName(); }

int getVisualStudioVersion() const override { return 15; }
String getSolutionComment() const override { return "# Visual Studio 2017"; }
String getToolsVersion() const override { return "15.0"; }
Expand Down Expand Up @@ -1844,6 +1848,8 @@ class MSVCProjectExporterVC2019 : public MSVCProjectExporterBase
static String getValueTreeTypeName() { return "VS2019"; }
static String getTargetFolderName() { return "VisualStudio2019"; }

Identifier getExporterIdentifier() const override { return getValueTreeTypeName(); }

int getVisualStudioVersion() const override { return 16; }
String getSolutionComment() const override { return "# Visual Studio 2019"; }
String getToolsVersion() const override { return "16.0"; }
Expand Down
Expand Up @@ -379,6 +379,8 @@ class MakefileProjectExporter : public ProjectExporter
static String getValueTreeTypeName() { return "LINUX_MAKE"; }
static String getTargetFolderName() { return "LinuxMakefile"; }

Identifier getExporterIdentifier() const override { return getValueTreeTypeName(); }

static MakefileProjectExporter* createForSettings (Project& projectToUse, const ValueTree& settingsToUse)
{
if (settingsToUse.hasType (getValueTreeTypeName()))
Expand Down
Expand Up @@ -305,6 +305,11 @@ class XcodeProjectExporter : public ProjectExporter
bool isOSX() const override { return ! iOS; }
bool isiOS() const override { return iOS; }

Identifier getExporterIdentifier() const override
{
return iOS ? getValueTreeTypeNameiOS() : getValueTreeTypeNameMac();
}

bool supportsPrecompiledHeaders() const override { return true; }

String getNewLineString() const override { return "\n"; }
Expand Down
Expand Up @@ -121,6 +121,7 @@ ProjectExporter::ExporterTypeInfo ProjectExporter::getTypeInfoForExporter (const
if (iter != typeInfos.end())
return *iter;

jassertfalse;
return {};
}

Expand Down
2 changes: 2 additions & 0 deletions extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h
Expand Up @@ -58,6 +58,8 @@ class ProjectExporter : private Value::Listener

static bool canProjectBeLaunched (Project*);

virtual Identifier getExporterIdentifier() const = 0;

//==============================================================================
// capabilities of exporter
virtual bool usesMMFiles() const = 0;
Expand Down

0 comments on commit 8c9c3c3

Please sign in to comment.