generic.cmake 953 B

1234567891011121314151617181920212223242526272829303132
  1. # SPDX-License-Identifier: Apache-2.0
  2. set_ifndef(ESPRESSIF_TOOLCHAIN_PATH "$ENV{ESPRESSIF_TOOLCHAIN_PATH}")
  3. set( ESPRESSIF_TOOLCHAIN_PATH ${ESPRESSIF_TOOLCHAIN_PATH} CACHE PATH "")
  4. assert( ESPRESSIF_TOOLCHAIN_PATH "ESPRESSIF_TOOLCHAIN_PATH is not set")
  5. set(TOOLCHAIN_HOME ${ESPRESSIF_TOOLCHAIN_PATH})
  6. set(COMPILER gcc)
  7. set(LINKER ld)
  8. set(BINTOOLS gnu)
  9. file(GLOB toolchain_paths
  10. LIST_DIRECTORIES true
  11. ${TOOLCHAIN_HOME}
  12. )
  13. if(toolchain_paths)
  14. list(GET toolchain_paths 0 soc_toolchain_path)
  15. get_filename_component(soc_toolchain "${soc_toolchain_path}" NAME)
  16. set(CROSS_COMPILE_TARGET ${soc_toolchain})
  17. set(SYSROOT_TARGET ${soc_toolchain})
  18. endif()
  19. set(CROSS_COMPILE ${TOOLCHAIN_HOME}/bin/${CROSS_COMPILE_TARGET}-)
  20. set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET})
  21. set(TOOLCHAIN_HAS_NEWLIB ON CACHE BOOL "True if toolchain supports newlib")
  22. message(STATUS "Found toolchain: espressif (${ESPRESSIF_TOOLCHAIN_PATH})")