-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I5f93f743ab77002f4149910d5ace47e0d37cca9f
- Loading branch information
1 parent
bc56515
commit 1a6e96e
Showing
5 changed files
with
85 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright (C) 2017 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
## | ||
|
||
cmake_minimum_required(VERSION 3.4.1) | ||
|
||
add_library(gpg_sdk STATIC IMPORTED) | ||
set_target_properties(gpg_sdk PROPERTIES IMPORTED_LOCATION | ||
${GPG_SDK_PATH}/lib/c++/${ANDROID_ABI}/libgpg.a) | ||
|
||
# build native_app_glue as a static lib | ||
add_library(native_app_glue STATIC | ||
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) | ||
|
||
# Export ANativeActivity_onCreate() | ||
# Refer to: https://github.com/android-ndk/ndk/issues/381. | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") | ||
|
||
add_library(native-activity | ||
SHARED | ||
src/main/jni/main.cpp | ||
src/main/jni/StateManager.cpp | ||
) | ||
|
||
target_include_directories(native-activity PRIVATE | ||
${ANDROID_NDK}/sources/android/native_app_glue | ||
${GPG_SDK_PATH}/include | ||
) | ||
|
||
target_link_libraries(native-activity | ||
gpg_sdk | ||
native_app_glue | ||
log | ||
android | ||
EGL | ||
GLESv1_CM | ||
z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,47 @@ | ||
/* | ||
* Copyright 2017 (C) Google LLC | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
apply plugin: 'com.android.application' | ||
|
||
// Depend on another project that downloads and unzips the C++ SDK. | ||
evaluationDependsOn(':Common/gpg-sdk') | ||
|
||
// As the plugin has created the build tasks, add the gpg-sdk task to | ||
// the task dependencies so it gets done before compiling | ||
tasks.whenTaskAdded { task -> | ||
project(':Common/gpg-sdk').defaultTasks.each { | ||
t ->task.dependsOn project(':Common/gpg-sdk').tasks[t] | ||
|
||
} | ||
} | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion '23.0.2' | ||
android { | ||
compileSdkVersion 26 | ||
defaultConfig { | ||
// | ||
// REPLACE THE APPLICATION ID with your bundle ID | ||
// | ||
// | ||
// REPLACE THE APPLICATION ID with your bundle ID | ||
// | ||
applicationId "com.google.example.games.ReplaceMe" | ||
minSdkVersion 14 | ||
targetSdkVersion 23 | ||
targetSdkVersion 26 | ||
|
||
ndk.abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a' | ||
|
||
ndk { | ||
abiFilters 'x86', 'armeabi-v7a' | ||
externalNativeBuild { | ||
cmake { | ||
cppFlags "-std=c++11 -Wall -frtti" | ||
arguments "-DGPG_SDK_PATH=${project(':Common:gpg-sdk').projectDir}/gpg-cpp-sdk/android", | ||
"-DANDROID_STL=c++_static" | ||
} | ||
} | ||
} | ||
|
||
externalNativeBuild { | ||
ndkBuild { | ||
path 'src/main/jni/Android.mk' | ||
} | ||
cmake.path "CMakeLists.txt" | ||
} | ||
} | ||
|
||
dependencies { | ||
compile 'com.google.android.gms:play-services-games:10.0.0' | ||
compile 'com.google.android.gms:play-services-nearby:10.0.0' | ||
compile 'com.android.support:support-v4:23.1.1' | ||
implementation 'com.google.android.gms:play-services-games:11.6.2' | ||
implementation 'com.google.android.gms:play-services-nearby:11.6.2' | ||
implementation 'com.android.support:support-v4:26.1.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters