summaryrefslogtreecommitdiff
path: root/xmake/toolchains/ifx/load.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/toolchains/ifx/load.lua')
-rw-r--r--xmake/toolchains/ifx/load.lua37
1 files changed, 5 insertions, 32 deletions
diff --git a/xmake/toolchains/ifx/load.lua b/xmake/toolchains/ifx/load.lua
index 31fbd3ae5..be2a48129 100644
--- a/xmake/toolchains/ifx/load.lua
+++ b/xmake/toolchains/ifx/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 ifx environment
function _add_ifxenv(toolchain, name, curenvs)
@@ -90,18 +66,15 @@ function _load_intel_on_windows(toolchain)
toolchain:set("toolset", "fcsh", "ifx.exe")
toolchain:set("toolset", "ar", "link.exe")
- -- add vs/ifx environments
+ -- add vs environments
+ toolchain_utils.add_vsenvs(toolchain)
+
+ -- add ifx 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_ifxenv(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