Added support for per-file NoPCH flag in the VS2010 generator (João Matos)

This commit is contained in:
Jason Perkins 2013-10-16 16:11:39 -04:00
parent d1eb67d43b
commit 2e08d5f218
2 changed files with 22 additions and 0 deletions

View File

@ -1005,6 +1005,8 @@
if filecfg then
if cfg.pchsource == filecfg.abspath and not cfg.flags.NoPCH then
vc2010.element(3, 'PrecompiledHeader', condition, 'Create')
elseif filecfg.flags.NoPCH then
vc2010.element(3, 'PrecompiledHeader', condition, 'NotUsing')
end
else
if not cfg.flags.NoPCH and cfg.pchheader then

View File

@ -303,3 +303,23 @@
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
]]
end
--
-- Check handling of per-file no PCH build options.
--
function suite.excludedFromPCH()
files { "hello.cpp" }
configuration "**.cpp"
flags { "NoPCH" }
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="hello.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
</ItemGroup>
]]
end