|
| 1 | +# Copyright (C) 2017 Google Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +## |
| 15 | + |
| 16 | +# For more information about using CMake with Android Studio, read the |
| 17 | +# documentation: https://d.android.com/studio/projects/add-native-code.html |
| 18 | + |
| 19 | +# Sets the minimum version of CMake required to build the native library. |
| 20 | + |
| 21 | +cmake_minimum_required(VERSION 3.4.1) |
| 22 | + |
| 23 | +# Creates and names a library, sets it as either STATIC |
| 24 | +# or SHARED, and provides the relative paths to its source code. |
| 25 | +# You can define multiple libraries, and CMake builds them for you. |
| 26 | +# Gradle automatically packages shared libraries with your APK. |
| 27 | + |
| 28 | +add_library( # Sets the name of the library. |
| 29 | + native-googlesignin |
| 30 | + |
| 31 | + # Sets the library as a shared library. |
| 32 | + SHARED |
| 33 | + |
| 34 | + # Provides a relative path to your source file(s). |
| 35 | + src/main/cpp/google_signin_bridge.cc |
| 36 | + src/main/cpp/google_signin.cc |
| 37 | + src/main/cpp/google_signin_user.cc |
| 38 | + src/main/cpp/jni.cc) |
| 39 | + |
| 40 | +# Searches for a specified prebuilt library and stores the path as a |
| 41 | +# variable. Because CMake includes system libraries in the search path by |
| 42 | +# default, you only need to specify the name of the public NDK library |
| 43 | +# you want to add. CMake verifies that the library exists before |
| 44 | +# completing its build. |
| 45 | + |
| 46 | +find_library( # Sets the name of the path variable. |
| 47 | + log-lib |
| 48 | + |
| 49 | + # Specifies the name of the NDK library that |
| 50 | + # you want CMake to locate. |
| 51 | + log ) |
| 52 | + |
| 53 | +# Specifies libraries CMake should link to your target library. You |
| 54 | +# can link multiple libraries, such as libraries you define in this |
| 55 | +# build script, prebuilt third-party libraries, or system libraries. |
| 56 | + |
| 57 | +target_link_libraries( # Specifies the target library. |
| 58 | + native-googlesignin |
| 59 | + |
| 60 | + # Links the target library to the log library |
| 61 | + # included in the NDK. |
| 62 | + ${log-lib} ) |
0 commit comments