zephyr/soc/xtensa/intel_s1000/xcc/CMakeLists.txt
Daniel Leung e73231f7f0 toolchain: xcc: use Clang if exists
The XCC toolchain may come with Clang front-end depending on
how it's built. Currently, the only SoC/board using XCC is
the intel_s1000_crb and its XCC toolchain comes with Clang
3.9.0 which has a lot better support for C99 and C++11 than
the portion based on GCC 4.2 (which does not even support
C++11). So this change attempts to use the Clang portion
instead of GCC if the Clang executable exists.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-07 17:09:38 +01:00

11 lines
440 B
CMake

# SPDX-License-Identifier: Apache-2.0
zephyr_library_sources_ifdef(CONFIG_CPLUSPLUS cpp_fixes.c)
zephyr_library_sources_ifdef(CONFIG_NEWLIB_LIBC newlib_fixes.c)
if(NOT (CC STREQUAL "clang"))
# These two are due to IS_ENABLED() not being parsed correctly
# in old GCC 4.2 based XCC. Clang is not affected.
zephyr_library_sources_ifdef(CONFIG_LOG_MINIMAL log_minimal_fixes.c)
zephyr_library_sources_ifdef(CONFIG_TEST ztest_fixes.c)
endif()