diff options
| author | ruki <[email protected]> | 2022-06-09 23:27:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-06-09 23:27:08 +0800 |
| commit | dfed765137f9cab024333b8ad30ddd7812266980 (patch) | |
| tree | 23738d4e669aae6cc6fb645cc345c89cbedeb665 /xmake/toolchains/msvc/check.lua | |
| parent | a45ec779fe73cd36e40181006c3103f7c4ec35da (diff) | |
improve to msvc version
Diffstat (limited to 'xmake/toolchains/msvc/check.lua')
| -rw-r--r-- | xmake/toolchains/msvc/check.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xmake/toolchains/msvc/check.lua b/xmake/toolchains/msvc/check.lua index b7d81a0e9..d92e231b3 100644 --- a/xmake/toolchains/msvc/check.lua +++ b/xmake/toolchains/msvc/check.lua @@ -68,12 +68,12 @@ function _check_vsenv(toolchain) -- check compiler local program = nil - local tool = find_tool("cl.exe", {force = true, envs = vcvars}) + local tool = find_tool("cl.exe", {version = true, force = true, envs = vcvars}) if tool then program = tool.program end if program then - return vsver + return vsver, tool end end end @@ -82,7 +82,7 @@ end -- check the visual studio function _check_vstudio(toolchain) - local vs = _check_vsenv(toolchain) + local vs, msvc = _check_vsenv(toolchain) if vs then if toolchain:is_global() then config.set("vs", vs, {force = true, readonly = true}) @@ -90,6 +90,14 @@ function _check_vstudio(toolchain) toolchain:config_set("vs", vs) toolchain:configs_save() cprint("checking for Microsoft Visual Studio (%s) version ... ${color.success}%s", toolchain:arch(), vs) + if msvc then + if option.get("verbose") and msvc.program then + cprint("checking for Microsoft C/C++ Compiler (%s) ... ${color.success}%s", toolchain:arch(), msvc.program) + end + if msvc.version then + cprint("checking for Microsoft C/C++ Compiler (%s) version ... ${color.success}%s", toolchain:arch(), msvc.version) + end + end else cprint("checking for Microsoft Visual Studio (%s) version ... ${color.nothing}${text.nothing}", toolchain:arch()) end |
