summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-08 22:59:07 +0800
committerruki <[email protected]>2024-07-08 22:59:07 +0800
commit6161154cd0ee1552f4a369d5da80c82c2fde9407 (patch)
tree684c3d1419236a48e94e095dabe9c8a868200237
parent8621473fcae841844b670173df23646f7e1a40d0 (diff)
support arm64ec
-rw-r--r--README.md2
-rw-r--r--README_zh.md2
-rw-r--r--xmake/modules/core/tools/cl.lua14
-rw-r--r--xmake/modules/detect/sdks/find_vstudio.lua24
-rw-r--r--xmake/toolchains/msvc/load.lua7
5 files changed, 29 insertions, 20 deletions
diff --git a/README.md b/README.md
index 3c80c5326..6620c6e0a 100644
--- a/README.md
+++ b/README.md
@@ -180,7 +180,7 @@ $ xmake f --menu
## Supported platforms
-* Windows (x86, x64, arm, arm64)
+* Windows (x86, x64, arm, arm64, arm64ec)
* macOS (i386, x86_64, arm64)
* Linux (i386, x86_64, arm, arm64, riscv, mips, 390x, sh4 ...)
* *BSD (i386, x86_64)
diff --git a/README_zh.md b/README_zh.md
index b08bf8d04..1b3f5437f 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -241,7 +241,7 @@ $ xmake f --menu
## 支持平台
-* Windows (x86, x64, arm, arm64)
+* Windows (x86, x64, arm, arm64, arm64ec)
* macOS (i386, x86_64, arm64)
* Linux (i386, x86_64, arm, arm64, riscv, mips, 390x, sh4 ...)
* *BSD (i386, x86_64)
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index be521098b..c4eede192 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -77,15 +77,15 @@ function init(self)
-- language
, ["-ansi"] = ""
, ["-std=c99"] = "-TP" -- compile as c++ files because msvc doesn't support c99
- , ["-std=c11"] = "-std:c11"
- , ["-std=c17"] = "-std:c17"
- , ["-std=c2x"] = "-std:clatest"
- , ["-std=c23"] = "-std:clatest"
+ , ["-std=c11"] = "-std:c11"
+ , ["-std=c17"] = "-std:c17"
+ , ["-std=c2x"] = "-std:clatest"
+ , ["-std=c23"] = "-std:clatest"
, ["-std=gnu99"] = "-TP" -- compile as c++ files because msvc doesn't support c99
- , ["-std=gnu11"] = "-std:c11"
+ , ["-std=gnu11"] = "-std:c11"
, ["-std=gnu17"] = "-std:c17"
- , ["-std=gnu2x"] = "-std:clatest"
- , ["-std=gnu23"] = "-std:clatest"
+ , ["-std=gnu2x"] = "-std:clatest"
+ , ["-std=gnu23"] = "-std:clatest"
, ["-std=.*"] = ""
-- others
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua
index 183f7162f..2ce2b44eb 100644
--- a/xmake/modules/detect/sdks/find_vstudio.lua
+++ b/xmake/modules/detect/sdks/find_vstudio.lua
@@ -266,10 +266,11 @@ function _find_vstudio(opt)
if vcvarsall and os.isfile(vcvarsall) and vsvers[VisualStudioVersion] then
-- load vcvarsall
- local vcvarsall_x86 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "x86", opt)
- local vcvarsall_x64 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "x64", opt)
- local vcvarsall_arm = _load_vcvarsall(vcvarsall, VisualStudioVersion, "arm", opt)
- local vcvarsall_arm64 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "arm64", opt)
+ local vcvarsall_x86 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "x86", opt)
+ local vcvarsall_x64 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "x64", opt)
+ local vcvarsall_arm = _load_vcvarsall(vcvarsall, VisualStudioVersion, "arm", opt)
+ local vcvarsall_arm64 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "arm64", opt)
+ local vcvarsall_arm64ec = vcvarsall_arm64
-- save results
local results = {}
@@ -280,7 +281,8 @@ function _find_vstudio(opt)
x86 = vcvarsall_x86,
x64 = vcvarsall_x64,
arm = vcvarsall_arm,
- arm64 = vcvarsall_arm64
+ arm64 = vcvarsall_arm64,
+ arm64ec = vcvarsall_arm64ec
}
}
return results
@@ -375,10 +377,11 @@ function _find_vstudio(opt)
if vcvarsall then
-- load vcvarsall
- local vcvarsall_x86 = _load_vcvarsall(vcvarsall, version, "x86", opt)
- local vcvarsall_x64 = _load_vcvarsall(vcvarsall, version, "x64", opt)
- local vcvarsall_arm = _load_vcvarsall(vcvarsall, version, "arm", opt)
- local vcvarsall_arm64 = _load_vcvarsall(vcvarsall, version, "arm64", opt)
+ local vcvarsall_x86 = _load_vcvarsall(vcvarsall, version, "x86", opt)
+ local vcvarsall_x64 = _load_vcvarsall(vcvarsall, version, "x64", opt)
+ local vcvarsall_arm = _load_vcvarsall(vcvarsall, version, "arm", opt)
+ local vcvarsall_arm64 = _load_vcvarsall(vcvarsall, version, "arm64", opt)
+ local vcvarsall_arm64ec = vcvarsall_arm64
-- save results
results[vsvers[version]] = {
@@ -388,7 +391,8 @@ function _find_vstudio(opt)
x86 = vcvarsall_x86,
x64 = vcvarsall_x64,
arm = vcvarsall_arm,
- arm64 = vcvarsall_arm64
+ arm64 = vcvarsall_arm64,
+ arm64ec = vcvarsall_arm64ec
}
}
end
diff --git a/xmake/toolchains/msvc/load.lua b/xmake/toolchains/msvc/load.lua
index 486c8e217..c5f2f6dac 100644
--- a/xmake/toolchains/msvc/load.lua
+++ b/xmake/toolchains/msvc/load.lua
@@ -57,7 +57,7 @@ function main(toolchain)
toolchain:set("toolset", "mrc", "rc.exe")
if toolchain:is_arch("x86") then
toolchain:set("toolset", "as", "ml.exe")
- elseif toolchain:is_arch("arm64") then
+ elseif toolchain:is_arch("arm64", "arm64ec") then
toolchain:set("toolset", "as", "[email protected]")
elseif toolchain:is_arch("arm.*") then
toolchain:set("toolset", "as", "[email protected]")
@@ -68,6 +68,11 @@ function main(toolchain)
toolchain:set("toolset", "sh", "link.exe")
toolchain:set("toolset", "ar", "link.exe")
+ -- init flags
+ if toolchain:is_arch("arm64ec") then
+ toolchain:add("cxflags", "/arm64EC")
+ end
+
-- add vs environments
local expect_vars = {"PATH", "LIB", "INCLUDE", "LIBPATH"}
local curenvs = os.getenvs()