Skip to content

Commit

Permalink
Merge pull request #2023 from Jarod42/openmp_msvc_with_clang
Browse files Browse the repository at this point in the history
Fix support of openmp for visual studio with clang toolset.
  • Loading branch information
samsinsane authored Apr 16, 2023
2 parents 168988a + dba322b commit 7ddf533
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/vstudio/tests/vc2019/test_compile_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@
]]
end

function suite.openmpOnWithClang()
toolset "clang"
openmp "On"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<OpenMPSupport>true</OpenMPSupport>
<AdditionalOptions>/openmp %(AdditionalOptions)</AdditionalOptions>
]]
end

--
-- Check ClCompile for ScanForModuleDependencies
--
Expand Down
4 changes: 4 additions & 0 deletions modules/vstudio/vs2010_vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,10 @@
elseif _ACTION >= "vs2019" and cfg.toolset and cfg.toolset == "clang" then
local value = iif(cfg.unsignedchar, "On", "Off")
table.insert(opts, p.tools.msc.shared.unsignedchar[value])
-- <OpenMPSupport>true</OpenMPSupport> is unfortunately ignored with clang toolset
if cfg.openmp == "On" then
table.insert(opts, 1, '/openmp')
end
end

if #opts > 0 then
Expand Down

0 comments on commit 7ddf533

Please sign in to comment.