2018-05-02 13:09:31 +08:00
|
|
|
set(CLANG_ROOT $ENV{CLANG_ROOT_DIR})
|
|
|
|
set_ifndef(CLANG_ROOT /usr)
|
2018-12-10 22:08:59 +08:00
|
|
|
|
2018-12-10 22:14:50 +08:00
|
|
|
set(TOOLCHAIN_HOME ${CLANG_ROOT}/bin/)
|
|
|
|
|
2018-05-02 13:09:31 +08:00
|
|
|
set(COMPILER clang)
|
|
|
|
|
2018-12-07 19:30:34 +08:00
|
|
|
if("${ARCH}" STREQUAL "arm")
|
|
|
|
set(triple arm-none-eabi)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nosys.specs")
|
|
|
|
elseif("${ARCH}" STREQUAL "x86")
|
|
|
|
set(triple i686-pc-none-elf)
|
2018-05-02 13:09:31 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_C_COMPILER_TARGET ${triple})
|
|
|
|
set(CMAKE_ASM_COMPILER_TARGET ${triple})
|
|
|
|
set(CMAKE_CXX_COMPILER_TARGET ${triple})
|