Skip to content

Commit

Permalink
openmp: add feature llvm (#3012)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE authored Dec 30, 2023
1 parent 06fd8ae commit 9f46bc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/o/openmp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package("openmp")
set_description("The OpenMP API specification for parallel programming")

add_configs("runtime", {description = "Set OpenMP runtime for gcc/clang like compilers.", default = "default", type = "string", values = {"default", "custom"}})
add_configs("experimental", {description = "Enable experimental OpenMP feature for msvc.", default = false, type = boolean})
add_configs("feature", {description = "Set OpenMP feature for msvc.", default = "default", type = "string", values = {"default", "experimental", "llvm"}})

on_load(function (package)
if package.has_tool then
Expand All @@ -29,7 +29,11 @@ package("openmp")
for _, toolkind in ipairs({"cc", "cxx"}) do
local flagname = toolkind == "cxx" and "cxxflags" or "cflags"
if package:has_tool(toolkind, "cl", "clang_cl") then
result[flagname] = (package:config("experimental") and "/openmp:experimental" or "/openmp")
if package:config("feature") == "default" then
result[flagname] = "/openmp"
else
result[flagname] = "/openmp:" .. package:config("feature")
end
if package:has_tool(toolkind, "clang_cl") then
result.links = "libomp"
end
Expand Down

0 comments on commit 9f46bc8

Please sign in to comment.