buildsystem: add perfetto to cmake

This commit is contained in:
Swung0x48 2025-02-23 19:17:30 +08:00
parent 8a268a12a6
commit 1123faab0f
3 changed files with 19 additions and 9 deletions

View File

@ -18,6 +18,8 @@ set(CMAKE_ANDROID_STL_TYPE c++_static)
set(CMAKE_BUILD_TYPE Release)
set(PROFILING ON)
find_library(GLSLANG_LIB glslang PATHS ${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/)
add_library(${CMAKE_PROJECT_NAME} SHARED
@ -56,6 +58,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libglslang.a
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libspirv-cross-c-shared.so
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libshaderconv.so
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libc++_shared.so
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libGenericCodeGen.a
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libglslang-default-resource-limits.a
${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/libMachineIndependent.a
@ -77,3 +80,11 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
target_include_directories(mobileglues PUBLIC
${CMAKE_SOURCE_DIR}/include
)
if (PROFILING)
find_package(Threads)
include_directories(${CMAKE_SOURCE_DIR}/3rdparty/perfetto/sdk)
add_library(perfetto STATIC ${CMAKE_SOURCE_DIR}/3rdparty/perfetto/sdk/perfetto.cc)
target_link_libraries(mobileglues perfetto ${CMAKE_THREAD_LIBS_INIT})
target_compile_definitions(mobileglues PUBLIC PROFILING=1)
endif()

View File

@ -15,7 +15,7 @@
NATIVE_FUNCTION_HEAD(void, glActiveTexture, GLenum texture) NATIVE_FUNCTION_END_NO_RETURN(void, glActiveTexture, texture)
NATIVE_FUNCTION_HEAD(void, glAttachShader, GLuint program, GLuint shader) NATIVE_FUNCTION_END_NO_RETURN(void, glAttachShader, program,shader)
NATIVE_FUNCTION_HEAD(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar *name) NATIVE_FUNCTION_END_NO_RETURN(void, glBindAttribLocation, program,index,name)
NATIVE_FUNCTION_HEAD(void, glBindBuffer, GLenum target, GLuint buffer) NATIVE_FUNCTION_END_NO_RETURN(void, glBindBuffer, target,buffer)
//NATIVE_FUNCTION_HEAD(void, glBindBuffer, GLenum target, GLuint buffer) NATIVE_FUNCTION_END_NO_RETURN(void, glBindBuffer, target,buffer)
//NATIVE_FUNCTION_HEAD(void, glBindFramebuffer, GLenum target, GLuint framebuffer) NATIVE_FUNCTION_END_NO_RETURN(void, glBindFramebuffer, target,framebuffer)
NATIVE_FUNCTION_HEAD(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer) NATIVE_FUNCTION_END_NO_RETURN(void, glBindRenderbuffer, target,renderbuffer)
//NATIVE_FUNCTION_HEAD(void, glBindTexture, GLenum target, GLuint texture) NATIVE_FUNCTION_END_NO_RETURN(void, glBindTexture, target,texture)

View File

@ -15,17 +15,16 @@
#include "egl/egl.h"
#include "egl/loader.h"
#define _mglues_dlopen(name) dlopen(name, RTLD_LAZY)
#define _mglues_dlclose(handle) dlclose(handle)
#define _mglues_dlsym(handle, name) dlsym(handle, name)
#ifdef __cplusplus
extern "C" {
#endif
static int g_initialized = 0;
void proc_init();
EGLContext mglues_eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
EGLBoolean mglues_eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
EGLBoolean mglues_eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
#ifdef __cplusplus
}
#endif
#endif //MOBILEGLUES_INCLUDES_H