CMakeLists.txt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. set(SOC_NAME ${IDF_TARGET})
  2. if(EXISTS "${COMPONENT_PATH}/${SOC_NAME}")
  3. include(${COMPONENT_PATH}/${SOC_NAME}/sources.cmake)
  4. spaces2list(EFUSE_SOC_SRCS)
  5. add_prefix(COMPONENT_SRCS "${SOC_NAME}/" ${EFUSE_SOC_SRCS})
  6. set(COMPONENT_ADD_INCLUDEDIRS include
  7. ${SOC_NAME}/include)
  8. endif()
  9. list(APPEND COMPONENT_SRCS "src/esp_efuse_api.c"
  10. "src/esp_efuse_fields.c"
  11. "src/esp_efuse_utility.c")
  12. set(COMPONENT_REQUIRES)
  13. set(COMPONENT_PRIV_REQUIRES bootloader_support)
  14. register_component()
  15. set(GEN_EFUSE_TABLE_ARG --max_blk_len ${CONFIG_EFUSE_MAX_BLK_LEN})
  16. ###################
  17. # Make common files esp_efuse_table.c and include/esp_efuse_table.h files.
  18. set(EFUSE_COMMON_TABLE_CSV_PATH "${COMPONENT_PATH}/${SOC_NAME}/esp_efuse_table.csv")
  19. add_custom_target(efuse_common_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_COMMON_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG})
  20. ###################
  21. # Make custom files project/main/esp_efuse_custom_table.c and project/main/include/esp_efuse_custom_table.h files.
  22. # Path to CSV file is relative to project path for custom CSV files.
  23. if(${CONFIG_EFUSE_CUSTOM_TABLE})
  24. # Custom filename expands any path relative to the project
  25. get_filename_component(EFUSE_CUSTOM_TABLE_CSV_PATH "${CONFIG_EFUSE_CUSTOM_TABLE_FILENAME}" ABSOLUTE BASE_DIR "${IDF_PROJECT_PATH}")
  26. add_custom_target(efuse_custom_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_COMMON_TABLE_CSV_PATH} ${EFUSE_CUSTOM_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG})
  27. else()
  28. add_custom_target(efuse_custom_table COMMAND)
  29. endif()#if(${CONFIG_EFUSE_CUSTOM_TABLE})
  30. add_custom_target(show_efuse_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_COMMON_TABLE_CSV_PATH} ${EFUSE_CUSTOM_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG} "--info")
  31. ###################
  32. # Generates files for unit test. This command is run manually.
  33. set(EFUSE_TEST_TABLE_CSV_PATH "${COMPONENT_PATH}/test/esp_efuse_test_table.csv")
  34. add_custom_target(efuse_test_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_TEST_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG})