ソースを参照

argtable: move GCC-specific pragma to cmake/make files

...and only add it when building with GCC.
Ivan Grokhotkov 4 年 前
コミット
82f0488f77

+ 4 - 0
components/console/CMakeLists.txt

@@ -6,3 +6,7 @@ idf_component_register(SRCS "commands.c"
                     INCLUDE_DIRS "."
                     REQUIRES vfs
                     PRIV_REQUIRES driver)
+
+if(CMAKE_C_COMPILER_ID MATCHES "GNU")
+    set_source_files_properties(argtable3/argtable3.c PROPERTIES COMPILE_FLAGS -Wno-clobbered)
+endif()

+ 0 - 2
components/console/argtable3/argtable3.c

@@ -30,8 +30,6 @@
 
 #include "argtable3.h"
 
-#pragma GCC diagnostic ignored "-Wclobbered"
-
 /*******************************************************************************
  * This file is part of the argtable3 library.
  *

+ 2 - 0
components/console/component.mk

@@ -1,2 +1,4 @@
 COMPONENT_ADD_INCLUDEDIRS := .
 COMPONENT_SRCDIRS := linenoise argtable3 .
+
+argtable3/argtable3.o: CFLAGS += -Wno-clobbered