fix crash caused by swappy on android
* fix native android crash Co-authored-by: Zeqiang Li <zeqiang-li@outlook.com.com>
This commit is contained in:
parent
660df56732
commit
5c20ccbf71
|
|
@ -34,7 +34,6 @@
|
|||
// to your game/engine's own Java component, you do not need to add the binary
|
||||
// resource and can instead define ANDROIDGAMESDK_NO_BINARY_DEX_LINKAGE which
|
||||
// will avoid the linker requiring these symbols.
|
||||
#define ANDROIDGAMESDK_NO_BINARY_DEX_LINKAGE
|
||||
#ifndef ANDROIDGAMESDK_NO_BINARY_DEX_LINKAGE
|
||||
extern const char _binary_classes_dex_start;
|
||||
extern const char _binary_classes_dex_end;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ set(IgnoreOldToolchainWarning "${ANDROID_UNIFIED_HEADERS}")
|
|||
# set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-s" )
|
||||
# set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--hash-style=both" )
|
||||
|
||||
#no statistics log
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG" )
|
||||
|
||||
set ( SOURCE_LOCATION ${CMAKE_CURRENT_LIST_DIR})
|
||||
set ( SOURCE_LOCATION_COMMON "${SOURCE_LOCATION}/common" )
|
||||
set ( SOURCE_LOCATION_OPENGL "${SOURCE_LOCATION}/opengl" )
|
||||
|
|
@ -50,11 +53,11 @@ if (ANDROID_NDK_MAJOR GREATER 22)
|
|||
endif()
|
||||
|
||||
add_custom_command(OUTPUT classes_dex.o
|
||||
COMMAND cd ../intermediates/dex/release/mergeDexRelease/out && ${CMAKE_LINKER} ${LINKER_TARGET_EMULATION_OPTION} -r -b binary -o ${CMAKE_CURRENT_BINARY_DIR}/classes_dex.o classes.dex
|
||||
COMMAND cd ${CMAKE_CURRENT_LIST_DIR}/ && ${CMAKE_LINKER} ${LINKER_TARGET_EMULATION_OPTION} -r -b binary -o ${CMAKE_CURRENT_BINARY_DIR}/classes_dex.o classes.dex
|
||||
WORKING_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
set_source_files_properties(SwappyDisplayManager
|
||||
classes_dex.o
|
||||
PROPERTIES
|
||||
EXTERNAL_OBJECT true
|
||||
|
|
@ -100,7 +103,7 @@ add_library( swappy_static
|
|||
STATIC
|
||||
|
||||
${SRC_FILE}
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/classes_dex.o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/classes_dex.o
|
||||
# Add new source files here
|
||||
)
|
||||
|
||||
|
|
@ -117,7 +120,6 @@ add_library( swappy
|
|||
${SWAPPY_C_SRC})
|
||||
|
||||
set(SWAPPY_ENABLED TRUE)
|
||||
|
||||
add_definitions(-DSWAPPY_ENABLED)
|
||||
|
||||
set(LIBS
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue