diff options
| author | ruki <[email protected]> | 2025-12-20 00:27:27 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-20 00:27:27 +0800 |
| commit | 50e52b0aa88b409f65181b8a6607427c8e17a28d (patch) | |
| tree | 8a972a4b311b310c8ba5f030b8b18dfe93b6dc07 /xmake/toolchains/icx/load.lua | |
| parent | dee8082d12241d69cf370c7f566c48c0ca8827bd (diff) | |
| parent | 4cb4b4e691ec53a7af6af9a862d332377fcd4ffe (diff) | |
Merge pull request #7152 from xmake-io/runtimes
Fix clang runtimes and improve toolchains
Diffstat (limited to 'xmake/toolchains/icx/load.lua')
| -rw-r--r-- | xmake/toolchains/icx/load.lua | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/xmake/toolchains/icx/load.lua b/xmake/toolchains/icx/load.lua index cd3064676..f91bd5348 100644 --- a/xmake/toolchains/icx/load.lua +++ b/xmake/toolchains/icx/load.lua @@ -21,31 +21,7 @@ -- imports import("core.base.option") import("core.project.config") -import("detect.sdks.find_vstudio") - --- add the given vs environment -function _add_vsenv(toolchain, name, curenvs) - - -- get vcvars - local vcvars = toolchain:config("vcvars") - if not vcvars then - return - end - - -- get the paths for the vs environment - local new = vcvars[name] - if new then - -- fix case naming conflict for cmake/msbuild between the new msvc envs and current environment, if we are running xmake in vs prompt. - -- @see https://github.com/xmake-io/xmake/issues/4751 - for k, c in pairs(curenvs) do - if name:lower() == k:lower() and name ~= k then - name = k - break - end - end - toolchain:add("runenvs", name, table.unpack(path.splitenv(new))) - end -end +import("private.utils.toolchain", {alias = "toolchain_utils"}) -- add the given icx environment function _add_icxenv(toolchain, name, curenvs) @@ -101,18 +77,15 @@ function _load_intel_on_windows(toolchain) toolchain:set("toolset", "as", "icx") end - -- add vs/icx environments + -- add vs environments + toolchain_utils.add_vsenvs(toolchain) + + -- add icx environments local expect_vars = {"PATH", "LIB", "INCLUDE", "LIBPATH"} local curenvs = os.getenvs() for _, name in ipairs(expect_vars) do - _add_vsenv(toolchain, name, curenvs) _add_icxenv(toolchain, name, curenvs) end - for _, name in ipairs(find_vstudio.get_vcvars()) do - if not table.contains(expect_vars, name:upper()) then - _add_vsenv(toolchain, name, curenvs) - end - end end -- load intel on linux |
