Commit 98a72ab3 authored by zhangyue's avatar zhangyue
Browse files

issue/111: 修改 kunlun xmake 支持自动获取机器架构

parent 650f3057
...@@ -20,14 +20,17 @@ rule("xpu") ...@@ -20,14 +20,17 @@ rule("xpu")
local objectfile = target:objectfile(sourcefile) local objectfile = target:objectfile(sourcefile)
local basename = objectfile:gsub("%.o$", "") local basename = objectfile:gsub("%.o$", "")
os.mkdir(path.directory(objectfile)) os.mkdir(path.directory(objectfile))
local cc = path.join(XTDK_DIR, "bin/clang++") local cc = path.join(XTDK_DIR, "bin/clang++")
local includedirs = table.concat(target:get("includedirs"), " ") local includedirs = table.concat(target:get("includedirs"), " ")
local arch_map = {
["x86_64"] = "x86_64-linux-gnu",
["arm64"] = "aarch64-linux-gnu"
}
local args = { local args = {
"--sysroot=/", "--sysroot=/",
"--target=aarch64-linux-gnu", "--target=" .. arch_map[os.arch()],
"-fPIC", "-fPIC",
"-pie", "-pie",
"--xpu-arch=xpu2", "--xpu-arch=xpu2",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment