clang build board test with h743

This commit is contained in:
hathach
2024-04-17 13:00:07 +07:00
parent 9f0e4c2889
commit 96f7ca02bf
5 changed files with 54 additions and 3 deletions

View File

@@ -10,13 +10,22 @@ get_filename_component(TOP ${TOP} ABSOLUTE)
# Toolchain
# Can be changed via -DTOOLCHAIN=gcc|iar or -DCMAKE_C_COMPILER=
#-------------------------------------------------------------
# Detect toolchain based on CMAKE_C_COMPILER
if (DEFINED CMAKE_C_COMPILER)
string(FIND ${CMAKE_C_COMPILER} "iccarm" IS_IAR)
string(FIND ${CMAKE_C_COMPILER} "clang" IS_CLANG)
string(FIND ${CMAKE_C_COMPILER} "gcc" IS_GCC)
if (NOT IS_IAR EQUAL -1)
set(TOOLCHAIN iar)
elseif (NOT IS_CLANG EQUAL -1)
set(TOOLCHAIN clang)
elseif (NOT IS_GCC EQUAL -1)
set(TOOLCHAIN gcc)
endif ()
endif ()
# default to gcc
if (NOT DEFINED TOOLCHAIN)
set(TOOLCHAIN gcc)
endif ()