Skip to content

Commit dba322b

Browse files
committed
Fix support of openmp for visual studio with clang toolset.
1 parent a46cb5b commit dba322b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

modules/vstudio/tests/vc2019/test_compile_settings.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@
7979
]]
8080
end
8181

82+
function suite.openmpOnWithClang()
83+
toolset "clang"
84+
openmp "On"
85+
prepare()
86+
test.capture [[
87+
<ClCompile>
88+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
89+
<WarningLevel>Level3</WarningLevel>
90+
<Optimization>Disabled</Optimization>
91+
<OpenMPSupport>true</OpenMPSupport>
92+
<AdditionalOptions>/openmp %(AdditionalOptions)</AdditionalOptions>
93+
]]
94+
end
95+
8296
--
8397
-- Check ClCompile for ScanForModuleDependencies
8498
--

modules/vstudio/vs2010_vcxproj.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,10 @@
16451645
elseif _ACTION >= "vs2019" and cfg.toolset and cfg.toolset == "clang" then
16461646
local value = iif(cfg.unsignedchar, "On", "Off")
16471647
table.insert(opts, p.tools.msc.shared.unsignedchar[value])
1648+
-- <OpenMPSupport>true</OpenMPSupport> is unfortunately ignored with clang toolset
1649+
if cfg.openmp == "On" then
1650+
table.insert(opts, 1, '/openmp')
1651+
end
16481652
end
16491653

16501654
if #opts > 0 then

0 commit comments

Comments
 (0)