From 9f46bc845239bda925ca219f10adf91bed6388f6 Mon Sep 17 00:00:00 2001 From: Chi Huu Huynh <73843190+Chi-EEE@users.noreply.github.com> Date: Sat, 30 Dec 2023 12:39:10 +0000 Subject: [PATCH] openmp: add feature llvm (#3012) --- packages/o/openmp/xmake.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/o/openmp/xmake.lua b/packages/o/openmp/xmake.lua index 87acd8e51..8d126e92c 100644 --- a/packages/o/openmp/xmake.lua +++ b/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