mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Add cmake option to strip the output of android builds
This commit is contained in:
@@ -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 )
|
||||
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user