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

build: add a workaround for Android builds #80

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
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
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ target_include_directories(firebase INTERFACE
if(ANDROID)
target_link_directories(firebase INTERFACE
third_party/firebase-development/usr/libs/android/${CMAKE_ANDROID_ARCH_ABI})

# Add the compiler resource directory as a library search path explicitly as
# we do not use `clang` from the NDK but do require `libunwind.a` which is not
# in the sysroot (platform SDK) but rather placed into the resource directory
# on the Android platform.
if(CMAKE_ANDROID_ARCH STREQUAL arm64)
compnerd marked this conversation as resolved.
Show resolved Hide resolved
target_link_directories(firebase INTERFACE
$ENV{ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17/lib/linux/aarch64)
elseif(CMAKE_ANDROID_ARCH STREQUAL arm)
target_link_directories(firebase INTERFACE
$ENV{ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17/lib/linux/arm)
elseif(CMAKE_ANDROID_ARCH STREQUAL x86)
target_link_directories(firebase INTERFACE
$ENV{ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17/lib/linux/i386)
elseif(CMAKE_ANDROID_ARCH STREQUAL x86_64)
target_link_directories(firebase INTERFACE
$ENV{ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17/lib/linux/x86_64)
else()
message(SEND_ERROR "unsupported architecture for Android")
endif()
elseif(WIN32)
target_link_directories(firebase INTERFACE
third_party/firebase-development/usr/libs/windows
Expand Down
Loading