Commit 35e6bf57 authored by Csaba Kertesz's avatar Csaba Kertesz

Refactor the needed Android NDK workaround without committed object file

parent e50e04bc
......@@ -1031,7 +1031,16 @@ endif(NOT BUILD_KSTARS_LITE)
add_library(kstars SHARED ${KSTARS_APP_SRCS})
add_dependencies(KStarsLib cfitsio indi nova raw)
target_link_libraries(kstars KStarsLib ${CMAKE_SOURCE_DIR}/android/hack/locale.ho -lgnustl_static)
# This hack is needed by a strange NDK bug. Some symbols are missing in locale.o (libc.a) at linking stage. But
# if we force-link with a working libc.a from android-24, there will be duplicated symbols, some symbols will
# conflict with libandroid_support.a what is also needed.
# Workaround: Extract the needed locale.o from libc.a of android-24 and link KStars Lite with it.
COMMAND ar -xv ${ANDROID_NDK}/platforms/android-24/arch-arm/usr/lib/libc.a locale.o
ADD_DEPENDENCIES(kstars extract_locale_o)
target_link_libraries(kstars KStarsLib ${CMAKE_BINARY_DIR}/locale.o -lgnustl_static)
else ()
add_executable(kstars ${KSTARS_APP_SRCS})
target_link_libraries(kstars KStarsLib)
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