Skip to content

Commit

Permalink
Merge pull request #808 from Blizzard/rtti-per-file
Browse files Browse the repository at this point in the history
Added per file rtti generation for Visual Studio
  • Loading branch information
tvandijck authored Jun 18, 2017
2 parents b22de64 + 4619b18 commit e007c34
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/actions/vstudio/vs2010_vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@
m.basicRuntimeChecks,
m.exceptionHandling,
m.compileAsManaged,
m.runtimeTypeInfo,
}
else
return {
Expand Down Expand Up @@ -2095,11 +2096,11 @@
end
end

function m.runtimeTypeInfo(cfg)
if cfg.rtti == p.OFF and cfg.clr == p.OFF then
m.element("RuntimeTypeInfo", nil, "false")
function m.runtimeTypeInfo(cfg, condition)
if cfg.rtti == p.OFF and ((not cfg.clr) or cfg.clr == p.OFF) then
m.element("RuntimeTypeInfo", condition, "false")
elseif cfg.rtti == p.ON then
m.element("RuntimeTypeInfo", nil, "true")
m.element("RuntimeTypeInfo", condition, "true")
end
end

Expand Down
29 changes: 29 additions & 0 deletions tests/actions/vstudio/vc2010/test_files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,35 @@
end



--
-- Check handling of per-file optimization levels.
--

function suite.onPerFileRttiOn()
files { "hello.cpp" }
filter "files:hello.cpp"
rtti "On"
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="hello.cpp">
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</RuntimeTypeInfo>
]]
end

function suite.onPerFileRttiOff()
files { "hello.cpp" }
filter "files:hello.cpp"
rtti "Off"
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="hello.cpp">
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</RuntimeTypeInfo>
]]
end

--
-- Check handling of per-file no PCH build options.
--
Expand Down

0 comments on commit e007c34

Please sign in to comment.