CMakeLists.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # the minimum version of CMake.
  2. cmake_minimum_required(VERSION 3.8)
  3. set(CC_LIB_NAME cocos)
  4. set(CC_PROJ_SOURCES)
  5. set(CC_COCOS_SOURCES)
  6. set(CC_COMMON_SOURCES)
  7. set(CC_ALL_SOURCES)
  8. option(APP_NAME "Project Name" "test-cases")
  9. project(${APP_NAME} CXX)
  10. set(CMAKE_CXX_FLAGS_DEBUG "-Werror=return-type -ferror-limit=0")
  11. enable_language(C ASM)
  12. set(CMAKE_CXX_STANDARD 17)
  13. include(${COCOS_X_PATH}/CMakeLists.txt)
  14. list(APPEND CC_ALL_SOURCES ${CC_COCOS_SOURCES} ${CC_COMMON_SOURCES} ${CC_PROJ_SOURCES})
  15. add_library(${CC_LIB_NAME} SHARED ${CC_ALL_SOURCES})
  16. # setup default flags
  17. cc_apply_definations(${CC_LIB_NAME})
  18. find_library( # Sets the name of the path variable.
  19. EGL-lib
  20. # Specifies the name of the NDK library that
  21. # you want CMake to locate.
  22. EGL )
  23. find_library( # Sets the name of the path variable.
  24. GLESv3-lib
  25. # Specifies the name of the NDK library that
  26. # you want CMake to locate.
  27. GLESv3)
  28. find_library( hilog-lib
  29. hilog_ndk.z )
  30. find_library( # Sets the name of the path variable.
  31. libace-lib
  32. # Specifies the name of the NDK library that
  33. # you want CMake to locate.
  34. ace_ndk.z )
  35. find_library( # Sets the name of the path variable.
  36. libnapi-lib
  37. # Specifies the name of the NDK library that
  38. # you want CMake to locate.
  39. ace_napi.z )
  40. find_library( # Sets the name of the path variable.
  41. libuv-lib
  42. # Specifies the name of the NDK library that
  43. # you want CMake to locate.
  44. uv )
  45. find_library( # Sets the name of the path variable.
  46. rawfile-lib
  47. # Specifies the name of the NDK library that
  48. # you want CMake to locate.
  49. rawfile.z )
  50. message(STATUS, "rawfile=${rawfile-lib}")
  51. target_link_libraries(${CC_LIB_NAME} PUBLIC
  52. ${EGL-lib} ${GLESv3-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} ${rawfile-lib} libnative_drawing.so libc++.a libOpenSLES.so
  53. ${CC_EXTERNAL_LIBS}
  54. )
  55. #cc_openharmony_before_target(${CC_LIB_NAME})
  56. #cc_openharmony_after_target(${CC_LIB_NAME})