summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-18 22:47:12 +0800
committerruki <[email protected]>2025-09-18 22:47:12 +0800
commitec133a69c703b26c8ae4ef61265287db604b9897 (patch)
treeee484ff2ed0978ef8d030d327321cabfc53050a6
parent7e3c48b59afbbb53a58951d81413cd438553ad05 (diff)
improve to check cl
-rw-r--r--xmake/core/base/os.lua2
-rw-r--r--xmake/toolchains/icc/check.lua6
-rw-r--r--xmake/toolchains/icx/check.lua4
-rw-r--r--xmake/toolchains/ifort/check.lua4
-rw-r--r--xmake/toolchains/ifx/check.lua4
-rw-r--r--xmake/toolchains/msvc/check.lua16
6 files changed, 16 insertions, 20 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index cecf38dd2..82da8e6d9 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -264,7 +264,7 @@ end
-- trace process for profile(stuck,trace)?
function os._is_tracing_process()
- local is_tracing = os._IS_TRACING_PROCESS
+ local is_tracing = true-- os._IS_TRACING_PROCESS
if is_tracing == nil then
local profile = os.getenv("XMAKE_PROFILE")
if profile then
diff --git a/xmake/toolchains/icc/check.lua b/xmake/toolchains/icc/check.lua
index 002b9e191..a88e309af 100644
--- a/xmake/toolchains/icc/check.lua
+++ b/xmake/toolchains/icc/check.lua
@@ -75,12 +75,12 @@ function _check_vsenv(toolchain)
if pathenv then
paths = path.splitenv(pathenv)
end
- local tool = find_tool("cl.exe", {version = true, force = true, paths = paths, envs = vcvars})
+ local tool = find_tool("cl.exe", {force = true, paths = paths, envs = vcvars})
if tool then
program = tool.program
end
if program then
- return vsver, tool
+ return vsver
end
end
end
@@ -117,7 +117,7 @@ function _check_intel_on_windows(toolchain)
local iclvarsall = iccenv.iclvars
local iclenv = iclvarsall[toolchain:arch()]
if iclenv and iclenv.PATH and iclenv.INCLUDE and iclenv.LIB then
- local tool = find_tool("icl.exe", {force = true, envs = iclenv, version = true})
+ local tool = find_tool("icl.exe", {force = true, envs = iclenv})
if tool then
cprint("checking for Intel C/C++ Compiler (%s) ... ${color.success}${text.success}", toolchain:arch())
toolchain:config_set("varsall", iclvarsall)
diff --git a/xmake/toolchains/icx/check.lua b/xmake/toolchains/icx/check.lua
index c781f5c8a..29fc56a7c 100644
--- a/xmake/toolchains/icx/check.lua
+++ b/xmake/toolchains/icx/check.lua
@@ -75,12 +75,12 @@ function _check_vsenv(toolchain)
if pathenv then
paths = path.splitenv(pathenv)
end
- local tool = find_tool("cl.exe", {version = true, force = true, paths = paths, envs = vcvars})
+ local tool = find_tool("cl.exe", {force = true, paths = paths, envs = vcvars})
if tool then
program = tool.program
end
if program then
- return vsver, tool
+ return vsver
end
end
end
diff --git a/xmake/toolchains/ifort/check.lua b/xmake/toolchains/ifort/check.lua
index ac8f31c6e..e9dd5c133 100644
--- a/xmake/toolchains/ifort/check.lua
+++ b/xmake/toolchains/ifort/check.lua
@@ -75,12 +75,12 @@ function _check_vsenv(toolchain)
if pathenv then
paths = path.splitenv(pathenv)
end
- local tool = find_tool("cl.exe", {version = true, force = true, paths = paths, envs = vcvars})
+ local tool = find_tool("cl.exe", {force = true, paths = paths, envs = vcvars})
if tool then
program = tool.program
end
if program then
- return vsver, tool
+ return vsver
end
end
end
diff --git a/xmake/toolchains/ifx/check.lua b/xmake/toolchains/ifx/check.lua
index 75264e14e..7a10a5865 100644
--- a/xmake/toolchains/ifx/check.lua
+++ b/xmake/toolchains/ifx/check.lua
@@ -75,12 +75,12 @@ function _check_vsenv(toolchain)
if pathenv then
paths = path.splitenv(pathenv)
end
- local tool = find_tool("cl.exe", {version = true, force = true, paths = paths, envs = vcvars})
+ local tool = find_tool("cl.exe", {force = true, paths = paths, envs = vcvars})
if tool then
program = tool.program
end
if program then
- return vsver, tool
+ return vsver,
end
end
end
diff --git a/xmake/toolchains/msvc/check.lua b/xmake/toolchains/msvc/check.lua
index 01a81ad93..37f38b53c 100644
--- a/xmake/toolchains/msvc/check.lua
+++ b/xmake/toolchains/msvc/check.lua
@@ -69,12 +69,12 @@ function _check_vsenv(toolchain)
-- check compiler
local program = nil
- local tool = find_tool("cl.exe", {version = true, force = true, envs = vcvars})
+ local tool = find_tool("cl.exe", {force = true, envs = vcvars})
if tool then
program = tool.program
end
if program then
- return vsver, tool
+ return vsver
end
end
end
@@ -83,16 +83,13 @@ end
-- check the visual studio
function _check_vstudio(toolchain)
- local vs, msvc = _check_vsenv(toolchain)
+ local vs = _check_vsenv(toolchain)
if vs then
if toolchain:is_global() then
config.set("vs", vs, {force = true, readonly = true})
end
toolchain:config_set("vs", vs)
cprint("checking for Microsoft Visual Studio (%s) version ... ${color.success}%s", toolchain:arch(), vs)
- if msvc and msvc.version then
- cprint("checking for Microsoft C/C++ Compiler (%s) version ... ${color.success}%s", toolchain:arch(), msvc.version)
- end
else
cprint("checking for Microsoft Visual Studio (%s) version ... ${color.nothing}${text.nothing}", toolchain:arch())
end
@@ -112,16 +109,15 @@ function _check_vc_build_tools(toolchain, sdkdir)
local vcvars = vcvarsall[toolchain:arch()]
if vcvars and vcvars.PATH and vcvars.INCLUDE and vcvars.LIB then
- -- save vcvars
toolchain:config_set("vcvars", vcvars)
toolchain:config_set("vcarchs", table.orderkeys(vcvarsall))
toolchain:config_set("vs_toolset", vcvars.VCToolsVersion)
toolchain:config_set("vs_sdkver", vcvars.WindowsSDKVersion)
-- check compiler
- local cl = find_tool("cl.exe", {version = true, force = true, envs = vcvars})
- if cl and cl.version then
- cprint("checking for Microsoft C/C++ Compiler (%s) version ... ${color.success}%s", toolchain:arch(), cl.version)
+ local cl = find_tool("cl.exe", {force = true, envs = vcvars})
+ if cl then
+ cprint("checking for Microsoft C/C++ Compiler (%s) ... ${color.success}", toolchain:arch())
end
return vcvars
end