CMakeLists.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. configure_file(include/app_config.h.in ${out_inc_dir}/app_config.h)
  12. set(target appstart)
  13. if(CONFIG_SOC_8910)
  14. add_library(${target} STATIC src/app_start_8910.c)
  15. target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_APPSTART)
  16. set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
  17. target_include_targets(${target} PRIVATE
  18. atr ats diag nvm kernel driver ml bdev fs fsmount
  19. net hal mal cfw fupdate service apploader
  20. audio tts
  21. )
  22. target_include_targets_if(CONFIG_AT_BT_APP_SUPPORT THEN ${target} PRIVATE bt_app)
  23. target_include_targets_if(CONFIG_BLUEU_BT_ENABLE THEN ${target} PRIVATE blueu)
  24. set_if(ldscript CONFIG_APP_RUN_ON_FLASH
  25. THEN ${SOURCE_TOP_DIR}/components/hal/ldscripts/8910_flashrun.ld
  26. OTHERWISE ${SOURCE_TOP_DIR}/components/hal/ldscripts/8910_ddrrun.ld
  27. )
  28. set_if(flash2_opt CONFIG_APP_FLASH2_ENABLED THEN WITH_FLASH2)
  29. add_uimage(${BUILD_TARGET} ${ldscript} ${dummy_cxx_file} ${flash2_opt})
  30. target_link_libraries(${BUILD_TARGET} PRIVATE all_libs ${target} all_libs)
  31. endif()
  32. if(CONFIG_SOC_8811)
  33. add_library(${target} STATIC src/app_start_8811.c)
  34. target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_APPSTART)
  35. set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
  36. target_include_targets(${target} PRIVATE
  37. atr ats kernel hal driver ml fs sffs fsmount mal service
  38. cfw net nvm diag apploader
  39. )
  40. add_simage(${BUILD_TARGET} ${appstart_ldscript} ${dummy_cxx_file}
  41. IMGVER ${CONFIG_APP_VERSION})
  42. target_link_libraries(${BUILD_TARGET} PRIVATE all_libs ${target} all_libs)
  43. endif()
  44. if(CONFIG_SOC_8850)
  45. add_library(${target} STATIC src/app_start_8850.c)
  46. target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_APPSTART)
  47. set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
  48. target_include_targets(${target} PRIVATE
  49. atr ats kernel hal driver ml fs sffs fsmount mal service
  50. cfw net nvm diag audio apploader bdev
  51. )
  52. if (CONFIG_PAM_LTE_GNSS_WIFISCAN_SUPPORT)
  53. target_include_targets(${target} PRIVATE pam)
  54. endif()
  55. if (CONFIG_SUPPORT_GNSS)
  56. target_include_targets(${target} PRIVATE gnss)
  57. endif()
  58. if(NOT QL_PROJECT_MIXER)
  59. #add_simage(${BUILD_TARGET} ${appstart_ldscript} ${dummy_cxx_file}) #quectel update
  60. set_if(flash2_opt CONFIG_APP_FLASH2_ENABLED THEN WITH_FLASH2)
  61. add_simage(${BUILD_TARGET} ${appstart_ldscript} ${dummy_cxx_file} ${flash2_opt})
  62. target_link_libraries(${BUILD_TARGET} PRIVATE all_libs ${target} all_libs ${QL_LIBS_PATH})
  63. endif()
  64. endif()
  65. if(CONFIG_TFM_SUPPORT)
  66. target_include_targets(${target} PRIVATE tfm
  67. )
  68. endif()
  69. if(CONFIG_TFM_TEST_SUPPORT)
  70. target_include_targets(${target} PRIVATE tf-m-tests tfm_non_secure_tests
  71. )
  72. endif()
  73. if(CONFIG_QUEC_PROJECT_FEATURE_TEESDK_VTRUST)
  74. target_include_targets(${target} PRIVATE vtrust
  75. )
  76. endif()
  77. relative_glob(srcs include/*.h src/*.c src/*.h)
  78. beautify_c_code(appstart ${srcs})