CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. # All rights reserved.
  3. #
  4. # This software is supplied "AS IS" without any warranties.
  5. # RDA assumes no responsibility or liability for the use of the software,
  6. # conveys no license or title under any patent, copyright, or mask work
  7. # right to the product. RDA reserves the right to make changes in the
  8. # software without notification. RDA also make no representation or
  9. # warranty that such application will be suitable for the specified use
  10. # without further testing or modification.
  11. set(target ql_app_hilinksdk)
  12. add_library(${target} STATIC)
  13. set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_app_lib_dir})
  14. target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_ALIYUN)
  15. target_include_directories(${target} PUBLIC adapter/include include )
  16. target_include_directories(${target} PUBLIC ${SOURCE_TOP_DIR}/components/newlib/include)
  17. target_link_libraries(${target} PRIVATE ${libc_file_name} ${libm_file_name} ${libgcc_file_name} )
  18. target_link_libraries(${target} PRIVATE ql_newlib)
  19. target_sources(${target} PRIVATE
  20. adapter/hilink_open_config_adapter.c
  21. adapter/hilink_open_mem_adapter.c
  22. adapter/hilink_open_nan_adapter.c
  23. adapter/hilink_open_network_adapter.c
  24. adapter/hilink_open_ota_adapter.c
  25. adapter/hilink_open_socket_adapter.c
  26. adapter/hilink_open_softap_adapter.c
  27. adapter/hilink_open_str_adapter.c
  28. adapter/hilink_open_sys_adapter.c
  29. adapter/hilink_open_timer_adapter.c
  30. hilink_device.c
  31. hilink_ota.c
  32. )
  33. # Use a global property to collect all application libraries
  34. define_property(GLOBAL PROPERTY ql_hilinksdk_lib
  35. BRIEF_DOCS "hilinksdk libraries"
  36. FULL_DOCS "hilinksdk libraries"
  37. )
  38. set(target ql_hilinksdk)
  39. set(ql_hilinksdk_out ${out_lib_dir}/ql_hilinksdk.a)
  40. get_property(ql_hilinksdk_lib GLOBAL PROPERTY ql_hilinksdk_lib)
  41. list(APPEND ql_hilinksdk_lib ${libc_file_name} ${libm_file_name} ${libgcc_file_name})
  42. list(APPEND ql_hilinksdk_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/tl8251/lib/debug/libhilinkbtsdk.a)
  43. list(APPEND ql_hilinksdk_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/WiFi/ota/debug/libhilinkota.a)
  44. list(APPEND ql_hilinksdk_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/WiFi/softap/debug/libhilinkdevicesdk.a)
  45. add_custom_command(OUTPUT ${ql_hilinksdk_out}
  46. COMMAND python3 ${groupgen_py} --base ${BINARY_TOP_DIR} ${ql_hilinksdk_out} ${ql_hilinksdk_lib}
  47. DEPENDS ${groupgen_py} ${ql_hilinksdk_lib}
  48. WORKING_DIRECTORY ${BINARY_TOP_DIR}
  49. )
  50. add_custom_target(build_${target} DEPENDS ${ql_hilinksdk_out})
  51. add_library(${target} STATIC IMPORTED GLOBAL)
  52. set_target_properties(${target} PROPERTIES IMPORTED_LOCATION ${ql_hilinksdk_out}
  53. IMPORTED_LINK_INTERFACE_LIBRARIES ql_app_hilinksdk)
  54. add_dependencies(${target} build_${target})
  55. relative_glob(srcs include/*.h )
  56. beautify_c_code(${target} ${srcs})