mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Escape special characters in MSVC project files
This commit is contained in:
parent
23e621f26e
commit
5f7ad995af
1 changed files with 10 additions and 2 deletions
|
|
@ -25,6 +25,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
inline String msBuildEscape (String str)
|
||||
{
|
||||
// see https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-special-characters?view=vs-2019
|
||||
for (const auto& special : { "%", "$", "@", "'", ";", "?", "\""})
|
||||
str = str.replace (special, "%" + String::toHexString (*special));
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class MSVCProjectExporterBase : public ProjectExporter
|
||||
|
|
@ -502,7 +510,7 @@ public:
|
|||
{
|
||||
auto* targetName = props->createNewChildElement ("TargetName");
|
||||
setConditionAttribute (*targetName, config);
|
||||
targetName->addTextElement (config.getOutputFilename ("", false, type == UnityPlugIn));
|
||||
targetName->addTextElement (msBuildEscape (config.getOutputFilename ("", false, type == UnityPlugIn)));
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -597,7 +605,7 @@ public:
|
|||
|
||||
auto externalLibraries = getExternalLibraries (config, getOwner().getExternalLibrariesString());
|
||||
auto additionalDependencies = type != SharedCodeTarget && externalLibraries.isNotEmpty()
|
||||
? getOwner().replacePreprocessorTokens (config, externalLibraries).trim() + ";%(AdditionalDependencies)"
|
||||
? msBuildEscape (getOwner().replacePreprocessorTokens (config, externalLibraries).trim()) + ";%(AdditionalDependencies)"
|
||||
: String();
|
||||
|
||||
auto librarySearchPaths = config.getLibrarySearchPaths();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue