diff options
| author | ruki <[email protected]> | 2020-05-20 23:54:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-20 17:28:18 +0800 |
| commit | 13373f2c9b1a80a8c766006a73f28e6adf83b929 (patch) | |
| tree | 18983adbaf3b9cd6bbe8a9096f70ecc86ae5a726 | |
| parent | a896b35be6d07660cf65c1885a41edd568e5fdf0 (diff) | |
improve to check vs
| -rw-r--r-- | xmake/platforms/windows/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/toolchains/vs/check.lua | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/xmake/platforms/windows/xmake.lua b/xmake/platforms/windows/xmake.lua index dd4e4da6f..19ee3bb7a 100644 --- a/xmake/platforms/windows/xmake.lua +++ b/xmake/platforms/windows/xmake.lua @@ -37,7 +37,7 @@ platform("windows") on_check("check") -- set toolchains - set_toolchains("vs", "yasm", "nasm", "cuda", "dlang", "rust", "go") + set_toolchains("vs", "clang", "yasm", "nasm", "cuda", "dlang", "rust", "go") -- set menu set_menu { diff --git a/xmake/toolchains/vs/check.lua b/xmake/toolchains/vs/check.lua index 57220f73b..12fac2aa0 100644 --- a/xmake/toolchains/vs/check.lua +++ b/xmake/toolchains/vs/check.lua @@ -83,7 +83,7 @@ function _check_vsenv() end -- check the visual studio -function main() +function _check_vstudio() local vs = _check_vsenv() if vs then config.set("vs", vs, {readonly = true, force = true}) @@ -100,3 +100,14 @@ function main() return vs end +-- main entry +function main() + -- @see https://github.com/xmake-io/xmake/pull/679 + local cc = path.basename(config.get("cc") or "cl"):lower() + local cxx = path.basename(config.get("cxx") or "cl"):lower() + local mrc = path.basename(config.get("mrc") or "rc"):lower() + if cc == "cl" or cxx == "cl" or mrc == "rc" then + return _check_vstudio(config) + end +end + |
