Merge pull request #768 from Blizzard/fix-vstudio

[core] Fix Visual Studio ExecutablePath settings.
This commit is contained in:
Samuel Surtees 2017-05-03 02:35:55 +10:00 committed by GitHub
commit 347c9c418d
2 changed files with 40 additions and 0 deletions

View File

@ -1875,6 +1875,12 @@
function m.executablePath(cfg)
local dirs = vstudio.path(cfg, cfg.bindirs)
if #dirs > 0 then
dirs = table.translate(dirs, function(dir)
if path.isabsolute(dir) then
return dir
end
return "$(ProjectDir)" .. dir
end)
m.element("ExecutablePath", nil, "%s;$(ExecutablePath)", table.concat(dirs, ";"))
end
end

View File

@ -289,3 +289,37 @@
</PropertyGroup>
]]
end
--
-- Check the handling of the VC++ ExecutablePath.
--
function suite.onBinDirsRelative()
bindirs { "../Include" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>bin\Debug\</OutDir>
<IntDir>obj\Debug\</IntDir>
<TargetName>MyProject</TargetName>
<TargetExt>.exe</TargetExt>
<ExecutablePath>$(ProjectDir)..\Include;$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
]]
end
function suite.onBinDirsAbsolute()
bindirs { "C:\\Include" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>bin\Debug\</OutDir>
<IntDir>obj\Debug\</IntDir>
<TargetName>MyProject</TargetName>
<TargetExt>.exe</TargetExt>
<ExecutablePath>C:\Include;$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
]]
end