File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,14 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
4949# xt toolchain only partially follows gcc convention
5050if (TOOLCHAIN STREQUAL "xt" )
5151 set (XCC 1)
52- set (CMAKE_C_COMPILER ${CROSS_COMPILE} xcc)
53- else ()
54- set (CMAKE_C_COMPILER ${CROSS_COMPILE} gcc)
5552endif ()
5653
54+ if (NOT DEFINED SOF_CC_BASE)
55+ set (SOF_CC_BASE "gcc" )
56+ endif ()
57+ # e.g.: "xt-" + "xcc"
58+ set (CMAKE_C_COMPILER ${CROSS_COMPILE}${SOF_CC_BASE} )
59+
5760find_program (CMAKE_LD NAMES "${CROSS_COMPILE} ld" PATHS ENV PATH NO_DEFAULT_PATH)
5861find_program (CMAKE_AR NAMES "${CROSS_COMPILE} ar" PATHS ENV PATH NO_DEFAULT_PATH)
5962find_program (CMAKE_RANLIB NAMES "${CROSS_COMPILE} ranlib" PATHS ENV PATH NO_DEFAULT_PATH)
Original file line number Diff line number Diff line change @@ -145,6 +145,15 @@ case "$platform" in
145145 ;;
146146esac
147147
148+ # Pre-zephyr "XTOS" build
149+ case " $platform " in
150+ none_yet)
151+ SOF_CC_BASE=' clang' ;;
152+ * )
153+ SOF_CC_BASE=' xcc' ;;
154+ esac
155+
156+ # For Zephyr unit tests, testbench,...
148157case " $platform " in
149158 imx8* |mtl|lnl)
150159 ZEPHYR_TOOLCHAIN_VARIANT=' xt-clang' ;;
Original file line number Diff line number Diff line change 231231 PATH=$XTENSA_TOOLS_DIR /XtensaTools/bin:$OLDPATH
232232 build_dir_suffix=' xcc'
233233 else
234+ # Override SOF_CC_BASE from set_xtensa_params.sh
235+ SOF_CC_BASE=' gcc'
234236 TOOLCHAIN=$HOST
235237 PATH=$SOF_TOP /../$HOST /bin:$OLDPATH
236238 build_dir_suffix=' gcc'
248250 printf ' PATH=%s\n' " $PATH "
249251 ( set -x # log the main commands and their parameters
250252 cmake -DTOOLCHAIN=" $TOOLCHAIN " \
253+ -DSOF_CC_BASE=" $SOF_CC_BASE " \
251254 -DROOT_DIR=" $ROOT " \
252255 -DMEU_OPENSSL=" ${MEU_OPENSSL} " \
253256 " ${MEU_PATH_OPTION} " \
You can’t perform that action at this time.
0 commit comments