Separate out debug information in Android build
authorChris Forbes <chrisforbes@google.com>
Thu, 14 Jun 2018 06:23:02 +0000 (23:23 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 15 Jun 2018 09:58:59 +0000 (05:58 -0400)
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

CMakeLists.txt

index d5a4e44..d88f26b 100644 (file)
@@ -295,6 +295,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)