diff options
| author | ruki <[email protected]> | 2025-05-18 22:51:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-05-18 22:51:11 +0800 |
| commit | a0db85a02c45598fd64b9811407a023b68e8b055 (patch) | |
| tree | a3972786207c0d30ed0c5c953a76509aa81cdb3a /xmake/toolchains/llvm/xmake.lua | |
| parent | 285b19a586c31295d4164d948d25c79f2914cd76 (diff) | |
improve llvm cross-compilation
Diffstat (limited to 'xmake/toolchains/llvm/xmake.lua')
| -rw-r--r-- | xmake/toolchains/llvm/xmake.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xmake/toolchains/llvm/xmake.lua b/xmake/toolchains/llvm/xmake.lua index 57638e4f6..2960858be 100644 --- a/xmake/toolchains/llvm/xmake.lua +++ b/xmake/toolchains/llvm/xmake.lua @@ -59,10 +59,6 @@ toolchain("llvm") end toolchain:add("ldflags", "-fuse-ld=lld") toolchain:add("shflags", "-fuse-ld=lld") - elseif toolchain:is_arch("x86_64", "x64") then - march = "-m64" - elseif toolchain:is_arch("i386", "x86") then - march = "-m32" elseif toolchain:is_plat("cross") then local sysroot local sdkdir = toolchain:sdkdir() @@ -90,6 +86,10 @@ toolchain("llvm") toolchain:add("ldflags", "--sysroot=" .. sysroot) toolchain:add("shflags", "--sysroot=" .. sysroot) end + elseif toolchain:is_arch("x86_64", "x64") then + march = "-m64" + elseif toolchain:is_arch("i386", "x86") then + march = "-m32" end if march then toolchain:add("cxflags", march) @@ -129,3 +129,4 @@ toolchain("llvm") toolchain:add("runenvs", "PATH", bindir) end end) + |
