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
This commit is contained in:
baldurk
2021-03-23 12:56:41 +00:00
parent 911d290948
commit 79e42bc365
2 changed files with 2 additions and 5 deletions
+2 -1
View File
@@ -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")
-4
View File
@@ -33,10 +33,6 @@
#include <string>
#include <android_native_app_glue.h>
#define ANativeActivity_onCreate __attribute__((visibility("default"))) ANativeActivity_onCreate
extern "C" {
#include <android_native_app_glue.c>
}
#include <android/log.h>
#define ANDROID_LOG(...) __android_log_print(ANDROID_LOG_INFO, "renderdoccmd", __VA_ARGS__);