Merge pull request #811 from Blizzard/preferredtoolarchitecture

Add 'preferredtoolarchitecture' API
This commit is contained in:
Tom van Dijck 2017-06-20 12:46:20 -07:00 committed by GitHub
commit 5d141f52a0
2 changed files with 27 additions and 0 deletions

View File

@ -127,6 +127,7 @@
m.keyword,
m.projectName,
m.targetPlatformVersion,
m.preferredToolArchitecture
}
end
@ -2172,6 +2173,21 @@
end
function m.preferredToolArchitecture(prj)
if _ACTION >= "vs2013" then
if prj.preferredtoolarchitecture == p.X86_64 then
m.element("PreferredToolArchitecture", nil, 'x64')
elseif prj.preferredtoolarchitecture == p.X86 then
m.element("PreferredToolArchitecture", nil, 'x86')
end
else
if prj.preferredtoolarchitecture == p.X86_64 then
m.element("UseNativeEnvironment", nil, 'true')
end
end
end
function m.treatLinkerWarningAsErrors(cfg)
if cfg.flags.FatalLinkWarnings then
local el = iif(cfg.kind == p.STATICLIB, "Lib", "Linker")

View File

@ -1246,6 +1246,17 @@
kind = "boolean",
}
api.register {
name = "preferredtoolarchitecture",
scope = "workspace",
kind = "string",
allowed = {
"Default",
p.X86,
p.X86_64,
}
}
-----------------------------------------------------------------------------
--
-- Field name aliases for backward compatibility