Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. # Sets the minimum version of CMake required to build the native
  2. # library. You should either keep the default value or only pass a
  3. # value of 3.4.0 or lower.
  4.  
  5. cmake_minimum_required(VERSION 3.4.1)
  6.  
  7. # Creates and names a library, sets it as either STATIC
  8. # or SHARED, and provides the relative paths to its source code.
  9. # You can define multiple libraries, and CMake builds it for you.
  10. # Gradle automatically packages shared libraries with your APK.
  11. include_directories(src/main/cpp/test)
  12.  
  13. add_library(test-lib SHARED src/main/cpp/test/test.cpp)
  14.  
  15. add_library( # Sets the name of the library.
  16. native-lib
  17.  
  18. # Sets the library as a shared library.
  19. SHARED
  20.  
  21. # Provides a relative path to your source file(s).
  22. # Associated headers in the same location as their source
  23. # file are automatically included.
  24. src/main/cpp/native-lib.cpp )
  25.  
  26. # Searches for a specified prebuilt library and stores the path as a
  27. # variable. Because system libraries are included in the search path by
  28. # default, you only need to specify the name of the public NDK library
  29. # you want to add. CMake verifies that the library exists before
  30. # completing its build.
  31.  
  32. find_library( # Sets the name of the path variable.
  33. log-lib
  34.  
  35. # Specifies the name of the NDK library that
  36. # you want CMake to locate.
  37. log )
  38.  
  39. # Specifies libraries CMake should link to your target library. You
  40. # can link multiple libraries, such as libraries you define in the
  41. # build script, prebuilt third-party libraries, or system libraries.
  42.  
  43. target_link_libraries( # Specifies the target library.
  44. native-lib
  45.  
  46. # Links the target library to the log library
  47. # included in the NDK.
  48. test-lib
  49. ${log-lib} )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement