Skip to content

Instantly share code, notes, and snippets.

@fantasyRqg
Created July 22, 2017 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fantasyRqg/7d430f6e5041a35bb7b54cd09734dd81 to your computer and use it in GitHub Desktop.
Save fantasyRqg/7d430f6e5041a35bb7b54cd09734dd81 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -frtti -fexceptions -Wall")
add_definitions(-DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES)
set(EXTERNAL_DIR ../../../../external)
file(GLOB_RECURSE Muses_SRC
"*.cpp"
#"*.h"
#"*.hpp"
)
set(Lib_Name "native-lib")
add_library(
${Lib_Name}
SHARED
${Muses_SRC})
target_include_directories(${Lib_Name} PRIVATE
${EXTERNAL_DIR}/glm
)
target_link_libraries(${Lib_Name}
android
mediandk
EGL
GLESv3
log )
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a'
// , 'armeabi-v7a', 'arm64-v8a'
}
externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-21'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:25.4.0'
testImplementation 'junit:junit:4.12'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment