CMakeLists.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/hal_config.h.in ${out_inc_dir}/hal_config.h)
  12. configure_file(include/8850/hal_chip_config.h.in ${out_inc_dir}/hal_chip_config.h)
  13. set(hal_spi_flash_prop_csv ${CMAKE_CURRENT_SOURCE_DIR}/src/hal_spi_flash_prop.csv)
  14. set(hal_spi_flash_prop_h ${CMAKE_CURRENT_BINARY_DIR}/hal_spi_flash_prop.h)
  15. add_custom_command(OUTPUT ${hal_spi_flash_prop_h}
  16. COMMAND python3 ${norpropgen_py} ${hal_spi_flash_prop_csv} ${hal_spi_flash_prop_h}
  17. DEPENDS ${norpropgen_py} ${hal_spi_flash_prop_csv}
  18. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  19. )
  20. if(NOT ${CONFIG_PINMUX_JSON_PATH} STREQUAL "")
  21. # Put the definition in respository make it easier to read codes
  22. set(pin_def_h ${CMAKE_CURRENT_SOURCE_DIR}/include/${CONFIG_SOC}/hal_iomux_pin.h)
  23. set(pinmux_json ${SOURCE_TOP_DIR}/${CONFIG_PINMUX_JSON_PATH})
  24. set(iomux_prop_h ${CMAKE_CURRENT_BINARY_DIR}/hal_iomux_prop.h)
  25. set(iomux_prop_h_in ${CMAKE_CURRENT_SOURCE_DIR}/src/hal_iomux_prop.h.in)
  26. set(pinmux_csv ${CMAKE_CURRENT_SOURCE_DIR}/config/${CONFIG_SOC}/pinmux_${CONFIG_SOC}.csv)
  27. add_custom_command(OUTPUT ${iomux_prop_h}
  28. COMMAND python3 ${iomuxgen_py} --chip ${CONFIG_SOC}
  29. ${pinmux_json} ${iomux_prop_h_in} ${iomux_prop_h} # ${pin_def_h}
  30. DEPENDS ${chip_iomuxgen_py} ${pinmux_json} ${pinmux_csv} ${iomux_prop_h_in}
  31. )
  32. endif()
  33. set(target hal_prop)
  34. add_app_libraries($<TARGET_FILE:${target}>)
  35. add_library(${target} STATIC)
  36. set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
  37. target_include_directories(${target} PUBLIC include include/hwregs/8850 include/8850)
  38. target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
  39. target_include_targets(${target} PUBLIC kernel)
  40. target_include_targets(${target} PRIVATE calclib fs nvm driver oql_core_boot_virt_func)
  41. target_link_libraries(${target} PRIVATE oql_core_boot_virt_func)
  42. target_sources(${target} PRIVATE
  43. src/ql_hal_spi_flash_prop.c
  44. ${hal_spi_flash_prop_h}
  45. src/hal_iomux.c
  46. ${iomux_prop_h}
  47. )
  48. set(target hal)
  49. include(core.cmake)
  50. relative_glob(srcs include/*.h src/*.c *.c inc/*.h)
  51. beautify_c_code(${target} ${srcs})