Separate out debug information in Android build
authorChris Forbes <chrisforbes@google.com>
Thu, 14 Jun 2018 06:23:02 +0000 (23:23 -0700)
committerJiayuan Ren <jiayuanr@nvidia.com>
Thu, 24 Jan 2019 00:37:36 +0000 (19:37 -0500)
We don't want to place the debug information in the APK, but we should
keep it around on the host so that the debugger can work.

In a "normal" Android app packaging process this is done for us by
gradle, but we roll our own. Do it as a CMake post-build step instead.

Change-Id: I59b13659d66333a06ce60b6057db19b39c067f53
Components: Framework
VK-GL-CTS: 1194
VK-GL-CTS: 1533
(cherry picked from commit 651bd0d1bcfc3763521f16bfd3b9a40396998e8c)

CMakeLists.txt

index 92a79e8..de988f1 100644 (file)
@@ -291,6 +291,11 @@ if (DE_OS_IS_ANDROID)
        add_library(deqp SHARED ${DEQP_SRCS})
        target_link_libraries(deqp ${DEQP_LIBS})
 
+       # Separate out the debug information because it's enormous
+       add_custom_command(TARGET deqp POST_BUILD
+               COMMAND ${CMAKE_STRIP} --only-keep-debug -o $<TARGET_FILE:deqp>.debug $<TARGET_FILE:deqp>
+               COMMAND ${CMAKE_STRIP} -g $<TARGET_FILE:deqp>)
+
        # Needed by OpenGL CTS that defines its own activity but depends on
        # common Android support code.
        target_include_directories(deqp PRIVATE framework/platform/android)