1cmake_minimum_required(VERSION 3.4.1) 2 3set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Werror -Wthread-safety" ) 4set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -O3 -fPIC" ) 5set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions" ) 6set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti" ) 7set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections" ) 8 9set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections" ) 10set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/version.script" ) 11set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-s" ) 12 13include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../include) 14 15add_library( androidgamesdk 16 17 SHARED 18 19 src/main/cpp/swappy/ChoreographerFilter.cpp 20 src/main/cpp/swappy/EGL.cpp 21 src/main/cpp/swappy/Swappy.cpp 22 src/main/cpp/swappy/Settings.cpp 23 src/main/cpp/swappy/Thread.cpp 24 src/main/cpp/swappy/Swappy_c.cpp) 25 26include_directories( src/main/cpp ) 27 28target_link_libraries( androidgamesdk 29 EGL 30 log ) 31