openmp: add feature llvm (#3012)

pull/3013/head
Chi Huu Huynh 11 months ago committed by GitHub
parent 06fd8ae941
commit 9f46bc8452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/o/openmp/xmake.lua

@ -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
@ -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

Loading…
Cancel
Save