Add per-configuration file lists for VC2010

This commit is contained in:
Jason Perkins 2012-02-14 16:39:51 -05:00
parent dac18c990b
commit 7350cc73dd
2 changed files with 24 additions and 0 deletions

View File

@ -394,6 +394,11 @@
for _, file in ipairs(files) do
_x(2,'<ClCompile Include=\"%s\">', path.translate(file.fullpath))
for cfg in project.eachconfig(prj) do
local filecfg = config.getfileconfig(cfg, file.abspath)
if not filecfg then
_p(3,'<ExcludedFromBuild %s>true</ExcludedFromBuild>', vc2010.condition(cfg))
end
if pchsource == file.fullpath and not cfg.flags.NoPCH then
_p(3,'<PrecompiledHeader %s>Create</PrecompiledHeader>', vc2010.condition(cfg))
end

View File

@ -88,3 +88,22 @@
</ItemGroup>
]]
end
--
-- If a file is excluded from a configuration, make sure it is marked as such.
--
function suite.excludedFromBuild_onExcludedFile()
files { "hello.cpp" }
configuration "Debug"
removefiles { "hello.cpp" }
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="hello.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
]]
end