Minor changes to improve patch-ability.

This commit is contained in:
Manu Evans 2013-10-29 15:43:35 +10:00
parent 3b5a070d42
commit d14a0f6ec8
5 changed files with 26 additions and 16 deletions

View File

@ -273,6 +273,7 @@
"Default",
"Fast",
"Strict",
"None",
}
}

View File

@ -53,14 +53,14 @@
--
function vstudio.archFromConfig(cfg, win32)
local iscpp = project.iscpp(cfg.project)
local isnative = project.isnative(cfg.project)
local arch = architecture(cfg.system, cfg.architecture)
if not arch then
arch = iif(iscpp, "x86", "Any CPU")
arch = iif(isnative, "x86", "Any CPU")
end
if win32 and iscpp and arch == "x86" then
if win32 and isnative and arch == "x86" then
arch = "Win32"
end
@ -212,12 +212,12 @@
end
-- scan the contained projects to identify the platform
local hascpp = false
local hasnative = false
local hasnet = false
local slnarch
for prj in solution.eachproject(cfg.solution) do
if project.iscpp(prj) then
hascpp = true
if project.isnative(prj) then
hasnative = true
elseif project.isdotnet(prj) then
hasnet = true
end
@ -239,7 +239,7 @@
return iif(hasnet, "x86", "Win32")
elseif slnarch then
return iif(slnarch == "x86" and not hasnet, "Win32", slnarch)
elseif hasnet and hascpp then
elseif hasnet and hasnative then
return "Mixed Platforms"
elseif hasnet then
return "Any CPU"
@ -260,7 +260,7 @@
--
function vstudio.solutionarch(cfg)
local hascpp = false
local hasnative = false
local hasdotnet = false
-- if the configuration has a platform identifier, use that as default
@ -270,13 +270,13 @@
--
for prj in solution.eachproject(cfg.solution) do
if project.iscpp(prj) then
hascpp = true
if project.isnative(prj) then
hasnative = true
elseif project.isdotnet(prj) then
hasdotnet = true
end
if hascpp and hasdotnet then
if hasnative and hasdotnet then
return "Mixed Platforms"
end
@ -291,7 +291,7 @@
end
-- use a default if no other architecture was specified
arch = arch or iif(hascpp, "Win32", "Any CPU")
arch = arch or iif(hasnative, "Win32", "Any CPU")
return arch
end
@ -327,9 +327,9 @@
--
function vstudio.tool(prj)
if (prj.language == "C#") then
if project.isdotnet(prj) then
return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC"
else
elseif project.iscpp(prj) then
return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942"
end
end

View File

@ -28,7 +28,7 @@
if premake.project.isdotnet(prj) then
premake.generate(prj, ".csproj", vstudio.cs2005.generate)
premake.generate(prj, ".csproj.user", vstudio.cs2005.generate_user)
else
elseif premake.project.iscpp(prj) then
premake.generate(prj, ".vcproj", vstudio.vc200x.generate)
premake.generate(prj, ".vcproj.user", vstudio.vc200x.generate_user)
end

View File

@ -39,7 +39,7 @@
if premake.project.isdotnet(prj) then
premake.generate(prj, ".csproj", vstudio.cs2005.generate)
premake.generate(prj, ".csproj.user", vstudio.cs2005.generate_user)
else
elseif premake.project.iscpp(prj) then
premake.generate(prj, ".vcxproj", vstudio.vc2010.generate)
premake.generate(prj, ".vcxproj.user", vstudio.vc2010.generateUser)

View File

@ -832,6 +832,15 @@
end
--
-- Returns true if the project uses a native language.
--
function project.isnative(prj)
return project.iscpp(prj)
end
--
-- Given a build config/platform pairing, applies any project configuration maps
-- and returns a new (or the same) pairing.