Write all config/architecture pairs into VS2010 project configurations element to avoid missing configurations

This commit is contained in:
Jason Perkins 2012-05-15 19:06:03 -04:00
parent cac52ce5d6
commit 9659541013
3 changed files with 26 additions and 7 deletions

View File

@ -125,9 +125,9 @@
-- form: <project platform name>|<architecture>.
--
function vstudio.configname(cfg)
function vstudio.configname(cfg, arch)
local platform = vstudio.projectplatform(cfg)
local architecture = vstudio.architecture(cfg)
local architecture = arch or vstudio.architecture(cfg)
return platform .. "|" .. architecture
end
@ -565,4 +565,4 @@
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
}

View File

@ -86,12 +86,23 @@
--
function vc2010.projectConfigurations(prj)
-- build a list of all architectures used in this project
local platforms = {}
for cfg in project.eachconfig(prj) do
local arch = vstudio.architecture(cfg)
if not table.contains(platforms, arch) then
table.insert(platforms, arch)
end
end
_p(1,'<ItemGroup Label="ProjectConfigurations">')
for cfg in project.eachconfig(prj) do
_x(2,'<ProjectConfiguration Include="%s">', vstudio.configname(cfg))
_x(3,'<Configuration>%s</Configuration>', vstudio.projectplatform(cfg))
_p(3,'<Platform>%s</Platform>', vstudio.architecture(cfg))
_p(2,'</ProjectConfiguration>')
for _, arch in ipairs(platforms) do
_x(2,'<ProjectConfiguration Include="%s">', vstudio.configname(cfg, arch))
_x(3,'<Configuration>%s</Configuration>', vstudio.projectplatform(cfg))
_p(3,'<Platform>%s</Platform>', vstudio.architecture(cfg))
_p(2,'</ProjectConfiguration>')
end
end
_p(1,'</ItemGroup>')
end

View File

@ -60,6 +60,14 @@
<Configuration>Debug x32</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug x32|x64">
<Configuration>Debug x32</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug x64|Win32">
<Configuration>Debug x64</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug x64|x64">
<Configuration>Debug x64</Configuration>
<Platform>x64</Platform>