Merge pull request #746 from LORgames/ssurtees/vs2010EscapeFixes
Fixed erroneous escape usages in VS2010+
This commit is contained in:
commit
53d83dffbe
@ -1799,7 +1799,7 @@
|
||||
function m.nmakePreprocessorDefinitions(cfg)
|
||||
if cfg.kind ~= p.NONE and #cfg.defines > 0 then
|
||||
local defines = table.concat(cfg.defines, ";")
|
||||
defines = p.esc(defines) .. ";$(NMakePreprocessorDefinitions)"
|
||||
defines = defines .. ";$(NMakePreprocessorDefinitions)"
|
||||
m.element('NMakePreprocessorDefinitions', nil, defines)
|
||||
end
|
||||
end
|
||||
@ -1914,7 +1914,7 @@
|
||||
if escapeQuotes then
|
||||
defines = defines:gsub('"', '\\"')
|
||||
end
|
||||
defines = p.esc(defines) .. ";%%(PreprocessorDefinitions)"
|
||||
defines = defines .. ";%%(PreprocessorDefinitions)"
|
||||
m.element('PreprocessorDefinitions', condition, defines)
|
||||
end
|
||||
end
|
||||
@ -1926,7 +1926,7 @@
|
||||
if escapeQuotes then
|
||||
undefines = undefines:gsub('"', '\\"')
|
||||
end
|
||||
undefines = p.esc(undefines) .. ";%%(UndefinePreprocessorDefinitions)"
|
||||
undefines = undefines .. ";%%(UndefinePreprocessorDefinitions)"
|
||||
m.element('UndefinePreprocessorDefinitions', condition, undefines)
|
||||
end
|
||||
end
|
||||
@ -2144,7 +2144,7 @@
|
||||
function m.disableSpecificWarnings(cfg, condition)
|
||||
if #cfg.disablewarnings > 0 then
|
||||
local warnings = table.concat(cfg.disablewarnings, ";")
|
||||
warnings = p.esc(warnings) .. ";%%(DisableSpecificWarnings)"
|
||||
warnings = warnings .. ";%%(DisableSpecificWarnings)"
|
||||
m.element('DisableSpecificWarnings', condition, warnings)
|
||||
end
|
||||
end
|
||||
@ -2153,7 +2153,7 @@
|
||||
function m.treatSpecificWarningsAsErrors(cfg, condition)
|
||||
if #cfg.fatalwarnings > 0 then
|
||||
local fatal = table.concat(cfg.fatalwarnings, ";")
|
||||
fatal = p.esc(fatal) .. ";%%(TreatSpecificWarningsAsErrors)"
|
||||
fatal = fatal .. ";%%(TreatSpecificWarningsAsErrors)"
|
||||
m.element('TreatSpecificWarningsAsErrors', condition, fatal)
|
||||
end
|
||||
end
|
||||
|
@ -270,6 +270,24 @@
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If defines are specified with escapable characters, they should be escaped.
|
||||
--
|
||||
|
||||
function suite.preprocessorDefinitions_onDefines()
|
||||
premake.escaper(premake.vstudio.vs2010.esc)
|
||||
defines { "&", "<", ">" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>&;<;>;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
]]
|
||||
premake.escaper(nil)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If undefines are specified, the <UndefinePreprocessorDefinitions> element should be added.
|
||||
--
|
||||
|
@ -126,6 +126,19 @@ command 2</NMakeBuildCommandLine>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onEscapedDefines()
|
||||
premake.escaper(premake.vstudio.vs2010.esc)
|
||||
defines { "&", "<", ">" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<NMakeOutput>$(OutDir)MyProject</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>&;<;>;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
premake.escaper(nil)
|
||||
end
|
||||
|
||||
function suite.onIncludeDirs()
|
||||
includedirs { "include/lua", "include/zlib" }
|
||||
prepare()
|
||||
|
Reference in New Issue
Block a user