2019-06-02 03:33:40 +08:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2019-03-19 22:12:36 +08:00
|
|
|
message(STATUS "Preparing Xtensa toolchain")
|
|
|
|
|
|
|
|
set(CMAKE_SYSTEM_NAME Generic)
|
|
|
|
set(CMAKE_SYSTEM_VERSION 1)
|
|
|
|
|
|
|
|
set(CMAKE_ASM_COMPILER_FORCED 1)
|
|
|
|
set(CMAKE_C_COMPILER_FORCED 1)
|
|
|
|
|
|
|
|
set(CMAKE_ASM_COMPILER_ID GNU)
|
|
|
|
set(CMAKE_C_COMPILER_ID GNU)
|
|
|
|
|
|
|
|
set(CROSS_COMPILE "xt-")
|
|
|
|
|
|
|
|
set(CMAKE_C_COMPILER ${CROSS_COMPILE}xcc)
|
|
|
|
|
2019-06-05 16:27:14 +08:00
|
|
|
find_program(CMAKE_LD NAMES "${CROSS_COMPILE}ld" PATHS ENV PATH NO_DEFAULT_PATH)
|
|
|
|
find_program(CMAKE_AR NAMES "${CROSS_COMPILE}ar" PATHS ENV PATH NO_DEFAULT_PATH)
|
|
|
|
find_program(CMAKE_OBJCOPY NAMES "${CROSS_COMPILE}objcopy" PATHS ENV PATH NO_DEFAULT_PATH)
|
|
|
|
find_program(CMAKE_OBJDUMP NAMES "${CROSS_COMPILE}objdump" PATHS ENV PATH NO_DEFAULT_PATH)
|
2019-03-19 22:12:36 +08:00
|
|
|
|
|
|
|
set(CMAKE_FIND_ROOT_PATH ".")
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
|
|
|
|
# Cmocka is written in C99, but for some reason it sets this flag, only on Posix
|
|
|
|
# We set up it here, because our system is Generic
|
|
|
|
add_definitions("-std=gnu99")
|