Browse Source

Projucer: Escape external library paths correctly

5f7ad995af introduced an issue where the
string of external libraries would be escaped in one go. This is
incorrect, because only the individual paths should be escaped. The
semicolons separating each path should not be escaped.
v6.1.6
reuk 4 years ago
parent
commit
0feda541e7
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
2 changed files with 19 additions and 15 deletions
  1. +17
    -14
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h
  2. +2
    -1
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h

+ 17
- 14
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h View File

@@ -606,9 +606,9 @@ public:
: "NDEBUG;%(PreprocessorDefinitions)");
}
auto externalLibraries = getExternalLibraries (config, getOwner().getExternalLibrariesString());
auto additionalDependencies = type != SharedCodeTarget && externalLibraries.isNotEmpty()
? msBuildEscape (getOwner().replacePreprocessorTokens (config, externalLibraries).trim()) + ";%(AdditionalDependencies)"
auto externalLibraries = getExternalLibraries (config, getOwner().getExternalLibrariesStringArray());
auto additionalDependencies = type != SharedCodeTarget && ! externalLibraries.isEmpty()
? externalLibraries.joinIntoString (";") + ";%(AdditionalDependencies)"
: String();
auto librarySearchPaths = config.getLibrarySearchPaths();
@@ -1332,22 +1332,25 @@ public:
return librarySearchPaths;
}
String getExternalLibraries (const MSVCBuildConfiguration& config, const String& otherLibs) const
StringArray getExternalLibraries (const MSVCBuildConfiguration& config, const StringArray& otherLibs) const
{
StringArray libraries;
const auto sharedCodeLib = [&]() -> StringArray
{
if (type != SharedCodeTarget)
if (auto* shared = getOwner().getSharedCodeTarget())
return { shared->getBinaryNameWithSuffix (config, false) };
if (otherLibs.isNotEmpty())
libraries.add (otherLibs);
return {};
}();
auto moduleLibs = getOwner().getModuleLibs();
if (! moduleLibs.isEmpty())
libraries.addArray (moduleLibs);
auto result = otherLibs;
result.addArray (getOwner().getModuleLibs());
result.addArray (sharedCodeLib);
if (type != SharedCodeTarget)
if (auto* shared = getOwner().getSharedCodeTarget())
libraries.add (shared->getBinaryNameWithSuffix (config, false));
for (auto& i : result)
i = msBuildEscape (getOwner().replacePreprocessorTokens (config, i).trim());
return libraries.joinIntoString (";");
return result;
}
String getDelayLoadedDLLs() const


+ 2
- 1
extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h View File

@@ -144,7 +144,8 @@ public:
String getExtraCompilerFlagsString() const { return extraCompilerFlagsValue.get().toString().replaceCharacters ("\r\n", " "); }
String getExtraLinkerFlagsString() const { return extraLinkerFlagsValue.get().toString().replaceCharacters ("\r\n", " "); }
String getExternalLibrariesString() const { return getSearchPathsFromString (externalLibrariesValue.get().toString()).joinIntoString (";"); }
StringArray getExternalLibrariesStringArray() const { return getSearchPathsFromString (externalLibrariesValue.get().toString()); }
String getExternalLibrariesString() const { return getExternalLibrariesStringArray().joinIntoString (";"); }
bool shouldUseGNUExtensions() const { return gnuExtensionsValue.get(); }


Loading…
Cancel
Save