From 79e42bc365001e02348fb4f993832feef3a0fb93 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 23 Mar 2021 12:56:41 +0000 Subject: [PATCH] Compile android_native_app_glue.c as C * It doesn't compile as C++ in latest compilers so we can't include it in-line in the C++ source --- renderdoccmd/CMakeLists.txt | 3 ++- renderdoccmd/renderdoccmd_android.cpp | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/renderdoccmd/CMakeLists.txt b/renderdoccmd/CMakeLists.txt index bfa10de74..137c3bcee 100644 --- a/renderdoccmd/CMakeLists.txt +++ b/renderdoccmd/CMakeLists.txt @@ -11,7 +11,8 @@ endif() if(APPLE) list(APPEND sources renderdoccmd_apple.cpp) elseif(ANDROID) - list(APPEND sources renderdoccmd_android.cpp) + string(REPLACE "\\" "/" GLUE_SOURCE "${ANDROID_NDK_ROOT_PATH}/sources/android/native_app_glue/android_native_app_glue.c") + list(APPEND sources renderdoccmd_android.cpp "${GLUE_SOURCE}") include_directories(${ANDROID_NDK_ROOT_PATH}/sources/android/native_app_glue) list(APPEND libraries PRIVATE -llog -landroid) set(LINKER_FLAGS "-Wl,--no-as-needed") diff --git a/renderdoccmd/renderdoccmd_android.cpp b/renderdoccmd/renderdoccmd_android.cpp index 46c47646c..98f2399c1 100644 --- a/renderdoccmd/renderdoccmd_android.cpp +++ b/renderdoccmd/renderdoccmd_android.cpp @@ -33,10 +33,6 @@ #include #include -#define ANativeActivity_onCreate __attribute__((visibility("default"))) ANativeActivity_onCreate -extern "C" { -#include -} #include #define ANDROID_LOG(...) __android_log_print(ANDROID_LOG_INFO, "renderdoccmd", __VA_ARGS__);