1cmake_minimum_required(VERSION 3.4.1) 2 3set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -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,-s" ) 11 12include_directories( ../../include ) 13include_directories( ../common ) 14include_directories( ${ANDROID_NDK}/sources/third_party/vulkan/src/common ) 15 16message( STATUS "Building swappyVk_static to ${CMAKE_CURRENT_BINARY_DIR}/build" ) 17add_library( swappyVk_static 18 19 STATIC 20 21 SwappyVk.cpp 22 ${ANDROID_NDK}/sources/third_party/vulkan/src/common/vulkan_wrapper.cpp 23 24 # Add new source files here 25 ) 26 27set_target_properties( swappyVk_static PROPERTIES 28 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build ) 29 30add_library( swappyVk 31 32 SHARED 33 34 SwappyVk.cpp 35 ) 36 37 38 target_link_libraries( swappyVk 39 40 swappyVk_static 41 android 42 log ) 43