From 1bd417ad683e3bdc90913be42255a217df069d5e Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 27 Nov 2023 10:51:15 +0100 Subject: [PATCH] fix(cmake): don't add Clang flags not supported in Apple toolchain --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a033c3d478..153d9e24f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,8 +121,10 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") list(APPEND compile_options "-Wno-c2x-extensions") # warning on xMPU_SETTINGS for esp32s2 has size 0 for C and 1 for C++ list(APPEND compile_options "-Wno-extern-c-compat") - # warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 - list(APPEND compile_options "-Wno-single-bit-bitfield-constant-conversion") + if(NOT (CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) + # warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 + list(APPEND compile_options "-Wno-single-bit-bitfield-constant-conversion") + endif() endif() # More warnings may exist in unit tests and example projects.