CMakeLists.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.4.1)
  5. # Creates and names a library, sets it as either STATIC
  6. # or SHARED, and provides the relative paths to its source code.
  7. # You can define multiple libraries, and CMake builds them for you.
  8. # Gradle automatically packages shared libraries with your APK.
  9. #include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/includes)
  10. #include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/external.json)
  11. #include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/encrypt)
  12. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/ DIR_SOURCE)
  13. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/external/json JSON_SOURCE)
  14. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/external/md5 MD5_SOURCE)
  15. #aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/encrypt ENCRYPT_SOURCE)
  16. add_library(
  17. yyxxgame
  18. SHARED
  19. ${DIR_SOURCE}
  20. ${JSON_SOURCE}
  21. ${MD5_SOURCE}
  22. )
  23. # Searches for a specified prebuilt library and stores the path as a
  24. # variable. Because CMake includes system libraries in the search path by
  25. # default, you only need to specify the name of the public NDK library
  26. # you want to add. CMake verifies that the library exists before
  27. # completing its build.
  28. find_library( # Sets the name of the path variable.
  29. log-lib
  30. # Specifies the name of the NDK library that
  31. # you want CMake to locate.
  32. log)
  33. # Specifies libraries CMake should link to your target library. You
  34. # can link multiple libraries, such as libraries you define in this
  35. # build script, prebuilt third-party libraries, or system libraries.
  36. target_link_libraries( # Specifies the target library.
  37. yyxxgame
  38. # Links the target library to the log library
  39. # included in the NDK.
  40. ${log-lib})