From e430629a1e9e4300bee7584c6b53c5f0412d5bb6 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter Date: Tue, 22 Nov 2022 10:14:12 +0100 Subject: [PATCH] xt-clang: Do not use -std=gnu99 for C++ Option -std=gnu99 applied to C++ files trigerrs warning for xcc compiler however throws error for xt-clang. This patch limits usage of this flag to C, ASM code only. Signed-off-by: Jaroslaw Stelter --- zephyr/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 6c3dec88b..3b77faba3 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -895,7 +895,8 @@ find_package(Python3 COMPONENTS Interpreter) set(PYTHON3 "${Python3_EXECUTABLE}") # SOF uses GNU C99 extensions. TODO other flags required ? -target_compile_options(SOF INTERFACE -std=gnu99 -fno-inline-functions) +target_compile_options(SOF INTERFACE -fno-inline-functions) +target_compile_options(SOF INTERFACE $<$: -std=gnu99>) # Toolchain info add_definitions(-DXCC_TOOLS_VERSION="${ZEPHYR_TOOLCHAIN_VARIANT}" -DCC_OPTIMIZE_FLAGS="${OPTIMIZATION_FLAG}")