Support LLVM platform toolset for MSC; Clang in Visual Studio.

This commit is contained in:
Manu Evans 2015-07-25 18:45:10 +10:00
parent 046da71a28
commit eab093302c
4 changed files with 39 additions and 6 deletions

View File

@ -976,11 +976,11 @@
end,
}
api.register {
name = "customtoolnamespace",
scope = "config",
kind = "string",
}
api.register {
name = "customtoolnamespace",
scope = "config",
kind = "string",
}
api.register {
name = "undefines",

View File

@ -1509,7 +1509,9 @@
function m.platformToolset(cfg)
local tool, version = p.config.toolset(cfg)
if version then
version = "v" .. version
if tonumber(version) ~= nil then
version = "v" .. version
end
else
local action = p.action.current()
version = action.vstudio.platformToolset

View File

@ -33,8 +33,15 @@
local parts
if identifier:startswith("v") then
parts = { "msc", identifier:sub(2) }
elseif identifier:startswith("llvm-vs") then -- support LLVM toolset in VS
parts = { "msc", "LLVM-vs" .. identifier:sub(8) }
else
parts = identifier:explode("-")
-- hack to check for LLVM toolsets, which would be corrupted by the previous line
if parts[1] == "msc" and parts[2] == "llvm" and parts[3]:startswith("vs") then
parts = { parts[1], "LLVM-" .. parts[3] }
end
end
return p.tools[parts[1]], parts[2]
end

View File

@ -86,3 +86,27 @@
<PlatformToolset>v100</PlatformToolset>
]]
end
function suite.canOverrideFromScript_withV()
toolset "v120_xp"
prepare()
test.capture [[
<PlatformToolset>v120_xp</PlatformToolset>
]]
end
function suite.canOverrideFromScript_withV()
toolset "LLVM-vs2010"
prepare()
test.capture [[
<PlatformToolset>LLVM-vs2010</PlatformToolset>
]]
end
function suite.canOverrideFromScript_withMsc()
toolset "msc-llvm-vs2014_xp"
prepare()
test.capture [[
<PlatformToolset>LLVM-vs2014_xp</PlatformToolset>
]]
end