Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndk: use unix path even on Windows #4903

Merged
merged 5 commits into from
Mar 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions xmake/toolchains/ndk/load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
SirLynix marked this conversation as resolved.
Show resolved Hide resolved
local triple = _get_triple(arch)
if ndkver and tonumber(ndkver) < 22 then
toolchain:add("cxflags", "-D__ANDROID_API__=" .. ndk_sdkver)
Expand All @@ -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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use path.unix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so path.unix(path.join(...)) instead of just formatting using unix sep? 😕

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
Expand Down
Loading