forked from android/ndk-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to audio-echo to use shared lib and add packing workaround in …
…CMakeLists.txt
Showing
5 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
local.properties | ||
build | ||
*~ | ||
externalNativeBuild | ||
.externalNativeBuild | ||
libwebp | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copy shared STL files to Android Studio output directory so they can be | ||
# packaged in the APK. | ||
# Usage: | ||
# | ||
# find_package(ndk-stl REQUIRED) | ||
# | ||
# or | ||
# | ||
# find_package(ndk-stl REQUIRED PATHS ".") | ||
|
||
if(NOT ${ANDROID_STL} MATCHES "_shared") | ||
return() | ||
endif() | ||
|
||
function(configure_shared_stl lib_path so_base) | ||
message("Configuring STL ${so_base} for ${ANDROID_ABI}") | ||
configure_file( | ||
"${ANDROID_NDK}/sources/cxx-stl/${lib_path}/libs/${ANDROID_ABI}/lib${so_base}.so" | ||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${so_base}.so" | ||
COPYONLY) | ||
endfunction() | ||
|
||
if("${ANDROID_STL}" STREQUAL "libstdc++") | ||
# The default minimal system C++ runtime library. | ||
elseif("${ANDROID_STL}" STREQUAL "gabi++_shared") | ||
# The GAbi++ runtime (shared). | ||
message(FATAL_ERROR "gabi++_shared was not configured by ndk-stl package") | ||
elseif("${ANDROID_STL}" STREQUAL "stlport_shared") | ||
# The STLport runtime (shared). | ||
configure_shared_stl("stlport" "stlport_shared") | ||
elseif("${ANDROID_STL}" STREQUAL "gnustl_shared") | ||
# The GNU STL (shared). | ||
configure_shared_stl("gnu-libstdc++/4.9" "gnustl_shared") | ||
elseif("${ANDROID_STL}" STREQUAL "c++_shared") | ||
# The LLVM libc++ runtime (static). | ||
configure_shared_stl("llvm-libc++" "c++_shared") | ||
else() | ||
message(FATAL_ERROR "STL configuration ANDROID_STL=${ANDROID_STL} is not supported") | ||
endif() | ||
|