summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Leclercq <[email protected]>2024-03-30 15:22:50 +0100
committerGitHub <[email protected]>2024-03-30 15:22:50 +0100
commit75d8f661e2a5fd4090c6f90512481f8613e540c9 (patch)
tree8540b984b3b57da7f0c503a6160cf1230343c649
parente9ded8fe9241b33bebd4902424ac4e0278386a36 (diff)
ndk: use unix path even on Windows
-rw-r--r--xmake/toolchains/ndk/load.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/toolchains/ndk/load.lua b/xmake/toolchains/ndk/load.lua
index 4e60f0075..9f11146b7 100644
--- a/xmake/toolchains/ndk/load.lua
+++ b/xmake/toolchains/ndk/load.lua
@@ -166,6 +166,8 @@ function main(toolchain)
-- add sysroot flags
local ndk_sysroot = toolchain:config("ndk_sysroot")
if ndk_sysroot and os.isdir(ndk_sysroot) then
+ -- use unix path separator on android as windows seps may not be understood by some tools (e.g. openssl's perl)
+ ndk_sysroot = path.unix(ndk_sysroot)
local triple = _get_triple(arch)
if ndkver and tonumber(ndkver) < 22 then
toolchain:add("cxflags", "-D__ANDROID_API__=" .. ndk_sdkver)
@@ -174,9 +176,9 @@ function main(toolchain)
toolchain:add("cflags", "--sysroot=" .. ndk_sysroot)
toolchain:add("cxxflags","--sysroot=" .. ndk_sysroot)
toolchain:add("asflags", "--sysroot=" .. ndk_sysroot)
- toolchain:add("cflags", "-isystem " .. path.join(ndk_sysroot, "usr", "include", triple))
- toolchain:add("cxxflags","-isystem " .. path.join(ndk_sysroot, "usr", "include", triple))
- toolchain:add("asflags", "-isystem " .. path.join(ndk_sysroot, "usr", "include", triple))
+ toolchain:add("cflags", "-isystem " .. format("%s/%s/%s/%s", ndk_sysroot, "usr", "include", triple))
+ toolchain:add("cxxflags","-isystem " .. format("%s/%s/%s/%s", ndk_sysroot, "usr", "include", triple))
+ toolchain:add("asflags", "-isystem " .. format("%s/%s/%s/%s", ndk_sysroot, "usr", "include", triple))
else
local ndk_sdkdir = path.translate(format("%s/platforms/android-%d", ndk, ndk_sdkver))
if os.isdir(ndk_sdkdir) then