Skip to content

Commit

Permalink
Merge pull request #768 from Blizzard/fix-vstudio
Browse files Browse the repository at this point in the history
[core] Fix Visual Studio ExecutablePath settings.
  • Loading branch information
samsinsane authored May 2, 2017
2 parents b6385ce + 289e880 commit 347c9c4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/actions/vstudio/vs2010_vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions tests/actions/vstudio/vc2010/test_output_props.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 347c9c4

Please sign in to comment.