When a `PREBUILT_STATIC_LIBRARY` uses C++ in its sources then the `.a` file will have a link-time dependency on the C++ runtime libraries. Android NDK r14 will add a way to give this information to the NDK build system by adding a `LOCAL_HAS_CPP` setting to the `Android.mk` file. Add this for exported static libraries that use C++.
12 lines
393 B
CMake
12 lines
393 B
CMake
project(build)
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
add_library(foo foo.cxx)
|
|
add_library(car foo.cxx)
|
|
add_library(bar bar.c)
|
|
add_library(dog foo.cxx)
|
|
target_link_libraries(foo car bar dog debug -lm)
|
|
export(TARGETS bar dog car foo ANDROID_MK
|
|
${build_BINARY_DIR}/Android.mk)
|
|
install(TARGETS bar dog car foo DESTINATION lib EXPORT myexp)
|
|
install(EXPORT_ANDROID_MK myexp DESTINATION share/ndk-modules)
|