Add cmake option to strip the output of android builds

This commit is contained in:
baldurk
2017-12-15 14:50:26 +00:00
parent 8d5a621ee1
commit 8c5f14436f
3 changed files with 14 additions and 0 deletions
+2
View File
@@ -7,6 +7,8 @@ if(BUILD_ANDROID)
CACHE STRING
"The Android toolchain file")
option(STRIP_ANDROID_LIBRARY "Strip the resulting android library" OFF)
# Set same default API level for ANDROID_ABI=armeabi-v7a as for arm64-v8a.
set( ANDROID_DEFAULT_NDK_API_LEVEL_arm 21 )
+6
View File
@@ -375,6 +375,12 @@ if(ANDROID)
set_target_properties(renderdoc PROPERTIES LINK_FLAGS "-Wl,--build-id")
# rename output library
set_target_properties(renderdoc PROPERTIES OUTPUT_NAME "VkLayer_GLES_RenderDoc")
if(STRIP_ANDROID_LIBRARY AND CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET renderdoc POST_BUILD
COMMAND echo Stripping $<TARGET_FILE:renderdoc>
COMMAND ${CMAKE_STRIP} --strip-unneeded $<TARGET_FILE:renderdoc>)
endif()
endif()
install (TARGETS renderdoc DESTINATION lib${LIB_SUFFIX}/${LIB_SUBFOLDER})
+6
View File
@@ -64,6 +64,12 @@ if(ANDROID)
message(FATAL_ERROR "ANDROID_SDK environment variable must be defined for Android build")
endif()
if(STRIP_ANDROID_LIBRARY AND CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET renderdoccmd POST_BUILD
COMMAND echo Stripping $<TARGET_FILE:renderdoccmd>
COMMAND ${CMAKE_STRIP} --strip-unneeded $<TARGET_FILE:renderdoccmd>)
endif()
set(ANDROID_BUILD_TOOLS_VERSION "" CACHE STRING "Version of Android build-tools to use instead of the default")
if(ANDROID_BUILD_TOOLS_VERSION STREQUAL "")
set(ANDROID_BUILD_TOOLS_VERSION "26.0.1")