CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # For more information about using CMake with Android Studio, read the
  2. # documentation: https://d.android.com/studio/projects/add-native-code.html
  3. # Sets the minimum version of CMake required to build the native library.
  4. cmake_minimum_required(VERSION 3.10.2)
  5. # Declares and names the project.
  6. project("sdk")
  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 them for you.
  10. # Gradle automatically packages shared libraries with your APK.
  11. aux_source_directory(../ios/Classes/src sdk_src)
  12. add_library( # Sets the name of the library.
  13. native-lib
  14. # Sets the library as a shared library.
  15. SHARED
  16. # Provides a relative path to your source file(s).
  17. ../ios/Classes/native-lib.cpp ${sdk_src})
  18. target_include_directories(native-lib PUBLIC ../ios/Classes/include)
  19. # Searches for a specified prebuilt library and stores the path as a
  20. # variable. Because CMake includes system libraries in the search path by
  21. # default, you only need to specify the name of the public NDK library
  22. # you want to add. CMake verifies that the library exists before
  23. # completing its build.
  24. find_library( # Sets the name of the path variable.
  25. log-lib
  26. # Specifies the name of the NDK library that
  27. # you want CMake to locate.
  28. log )
  29. # Specifies libraries CMake should link to your target library. You
  30. # can link multiple libraries, such as libraries you define in this
  31. # build script, prebuilt third-party libraries, or system libraries.
  32. target_link_libraries( # Specifies the target library.
  33. native-lib
  34. # Links the target library to the log library
  35. # included in the NDK.
  36. ${log-lib} )