From 369cf45da4e5ed5a332afc1abcfe3b51bf98ad59 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Aug 2022 21:57:01 +0800 Subject: improve msvc --- xmake/modules/detect/sdks/find_vstudio.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index f871c2262..890dd7cc1 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -320,9 +320,10 @@ function _find_vstudio(opt) -- load vcvarsall local vcvarsall_x86 = _load_vcvarsall(vcvarsall, version, "x86", opt) local vcvarsall_x64 = _load_vcvarsall(vcvarsall, version, "x64", opt) + local vcvarsall_arm64 = _load_vcvarsall(vcvarsall, version, "arm64", opt) -- save results - results[vsvers[version]] = {version = version, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64}} + results[vsvers[version]] = {version = version, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64, arm64 = vcvarsall_arm64}} end end return results -- cgit v1.3.1 From 0697f30e886d3fae794683ea66737186f4643c7f Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Aug 2022 21:58:20 +0800 Subject: add arm64 --- xmake/platforms/windows/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/platforms/windows/xmake.lua b/xmake/platforms/windows/xmake.lua index 6f25ef914..6dc3d7682 100644 --- a/xmake/platforms/windows/xmake.lua +++ b/xmake/platforms/windows/xmake.lua @@ -28,7 +28,7 @@ platform("windows") set_hosts("windows") -- set archs - set_archs("x86", "x64") + set_archs("x86", "x64", "arm64") -- set formats set_formats("static", "$(name).lib") -- cgit v1.3.1 From 2cfd0fe1d5184a247fbeec988583a4922a324cbc Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Aug 2022 22:04:02 +0800 Subject: fix format --- xmake/modules/detect/sdks/find_vstudio.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 890dd7cc1..9bc4cdc51 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -116,7 +116,7 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt) file:print("set VSCMD_SKIP_SENDTELEMETRY=yes") end if opt.vcvars_ver then - file:print("call \"%s\" %s %s -vcvars_ver=%s > nul", vcvarsall, arch, opt.sdkver and opt.sdkver or "", opt.vcvars_ver) + file:print("call \"%s\" %s %s -vcvars_ver=%s > nul", vcvarsall, arch, opt.sdkver and opt.sdkver or "", opt.vcvars_ver) else file:print("call \"%s\" %s %s > nul", vcvarsall, arch, opt.sdkver and opt.sdkver or "") end -- cgit v1.3.1 From d08a04653479ef0f4f503412552aabe4b50c7b09 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Aug 2022 22:17:44 +0800 Subject: load armv6 vavars --- xmake/modules/detect/sdks/find_vstudio.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 9bc4cdc51..37568a24d 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -320,7 +320,18 @@ function _find_vstudio(opt) -- load vcvarsall local vcvarsall_x86 = _load_vcvarsall(vcvarsall, version, "x86", opt) local vcvarsall_x64 = _load_vcvarsall(vcvarsall, version, "x64", opt) - local vcvarsall_arm64 = _load_vcvarsall(vcvarsall, version, "arm64", opt) + + -- load vcvarsall for arm64 + local arch + local arch_os = os.arch() + if arch_os == "x64" then + arch = "x64_arm64" + elseif arch_os == "x86" then + arch = "x86_arm64" + elseif arch_os == "arm64" then + arch = "arm64" + end + local vcvarsall_arm64 = arch and _load_vcvarsall(vcvarsall, version, arch, opt) or nil -- save results results[vsvers[version]] = {version = version, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64, arm64 = vcvarsall_arm64}} -- cgit v1.3.1