2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-12-13 23:32:07 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_arm arm-zephyr-eabi)
|
|
|
|
set(CROSS_COMPILE_TARGET_nios2 nios2-zephyr-elf)
|
2019-07-18 01:17:05 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_riscv riscv32-zephyr-elf)
|
2018-12-13 23:32:07 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_mips mipsel-zephyr-elf)
|
|
|
|
set(CROSS_COMPILE_TARGET_xtensa xtensa-zephyr-elf)
|
|
|
|
set(CROSS_COMPILE_TARGET_arc arc-zephyr-elf)
|
2019-05-07 23:37:46 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_x86_64 x86_64-zephyr-elf)
|
2019-08-23 10:46:50 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_x86 i586-zephyr-elf)
|
2018-12-13 23:32:07 +08:00
|
|
|
|
|
|
|
set(CROSS_COMPILE_TARGET ${CROSS_COMPILE_TARGET_${ARCH}})
|
|
|
|
set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET})
|
|
|
|
|
|
|
|
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
|
|
|
|
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})
|
2019-01-04 22:38:43 +08:00
|
|
|
|
|
|
|
if("${ARCH}" STREQUAL "xtensa")
|
|
|
|
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET})
|
|
|
|
set(TOOLCHAIN_INCLUDES
|
|
|
|
${SYSROOT_DIR}/include/arch/include
|
|
|
|
${SYSROOT_DIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
LIST(APPEND TOOLCHAIN_LIBS hal)
|
|
|
|
LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib)
|
2019-05-07 23:37:46 +08:00
|
|
|
elseif("${ARCH}" STREQUAL "x86_64")
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mx32)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mx32)
|
2019-01-04 22:38:43 +08:00
|
|
|
endif()
|