Merge pull request #1570 from hannes-harnisch/master

Initial C++20 module support for Visual Studio
This commit is contained in:
starkos 2021-05-16 16:04:03 -04:00 committed by GitHub
commit 23f32c2759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 0 deletions

View File

@ -1180,6 +1180,45 @@
]]
end
function suite.onCompileAsCppModule()
compileas 'Module'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<CompileAs>CompileAsCppModule</CompileAs>
</ClCompile>
]]
end
function suite.onCompileAsCppModulePartition()
compileas 'ModulePartition'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<CompileAs>CompileAsCppModuleInternalPartition</CompileAs>
</ClCompile>
]]
end
function suite.onCompileAsCppHeaderUnit()
compileas 'HeaderUnit'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<CompileAs>CompileAsHeaderUnit</CompileAs>
</ClCompile>
]]
end
--
-- Check handling of the C++14 & C++17 api

View File

@ -1699,6 +1699,12 @@
m.element("CompileAs", condition, "CompileAsC")
elseif p.languages.iscpp(cfg.compileas) then
m.element("CompileAs", condition, "CompileAsCpp")
elseif cfg.compileas == "Module" then
m.element("CompileAs", condition, "CompileAsCppModule")
elseif cfg.compileas == "ModulePartition" then
m.element("CompileAs", condition, "CompileAsCppModuleInternalPartition")
elseif cfg.compileas == "HeaderUnit" then
m.element("CompileAs", condition, "CompileAsHeaderUnit")
end
end

View File

@ -185,6 +185,9 @@
"C++",
"Objective-C",
"Objective-C++",
"Module",
"ModulePartition",
"HeaderUnit"
}
}