]> granicus.if.org Git - esp-idf/commitdiff
cmake: silence some warnings in coap, bt, expat, libsodium, lwip and examples/bluetooth
authorAnton Maklakov <anton@espressif.com>
Tue, 18 Sep 2018 03:44:24 +0000 (11:44 +0800)
committerAnton Maklakov <anton@espressif.com>
Thu, 20 Sep 2018 10:53:15 +0000 (18:53 +0800)
components/bt/CMakeLists.txt
components/coap/CMakeLists.txt
components/expat/CMakeLists.txt
components/libsodium/CMakeLists.txt
components/lwip/CMakeLists.txt
examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt

index 1bcea86c4c3de6d259c84a7190011dbe6558b7db..df32f9f94b81fedd49d4ce4f6c5b4f434ec170e9 100644 (file)
@@ -277,6 +277,10 @@ set(COMPONENT_PRIV_REQUIRES nvs_flash)
 register_component()
 
 if(CONFIG_BT_ENABLED)
+    if(GCC_NOT_5_2_0)
+        component_compile_options(-Wno-implicit-fallthrough -Wno-unused-const-variable)
+    endif()
+
     target_link_libraries(bt "-L${CMAKE_CURRENT_LIST_DIR}/lib")
     target_link_libraries(bt btdm_app)
 endif()
index 225745e8c43a1ea9a310bd00591fe5d1b4370ef6..a7800e64f03a676a421cd528ecb7a66a8173e277 100644 (file)
@@ -32,8 +32,10 @@ set_source_files_properties(
     PROPERTIES COMPILE_FLAGS
     -Wno-write-strings)
 
-# Temporary suppress "fallthrough" warnings until they are fixed in libcoap repo
-set_source_files_properties(
-    libcoap/src/option.c
-    PROPERTIES COMPILE_FLAGS
-    -Wno-implicit-fallthrough)
+if(GCC_NOT_5_2_0)
+    # Temporary suppress "fallthrough" warnings until they are fixed in libcoap repo
+    set_source_files_properties(
+        libcoap/src/option.c
+        PROPERTIES COMPILE_FLAGS
+        -Wno-implicit-fallthrough)
+endif()
\ No newline at end of file
index 02037dc21a8b4e8f5491ac9164b0ea15229c17b7..821705658a5056a1bd4489475dc26b9e4a87a5d7 100644 (file)
@@ -14,4 +14,6 @@ component_compile_definitions(HAVE_EXPAT_CONFIG_H)
 component_compile_definitions(HAVE_GETRANDOM)
 
 # Temporary suppress "fallthrough" warnings until they are fixed in expat repo
-component_compile_options(-Wno-implicit-fallthrough)
+if(GCC_NOT_5_2_0)
+    component_compile_options(-Wno-implicit-fallthrough)
+endif()
\ No newline at end of file
index 2ed003f13dd93dc48da6c7439f232199c9768c1c..aa39b00472fce70e33c8e6b9ddbf58e767f7bf5a 100644 (file)
@@ -139,11 +139,8 @@ component_compile_definitions(
     __STDC_CONSTANT_MACROS
     )
 
-component_compile_options(-Wno-unknown-pragmas)
-
 # patch around warnings in third-party files
 set_source_files_properties(
-    ${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c
     ${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c
     ${SRC}/crypto_pwhash/argon2/argon2-core.c
     ${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
@@ -155,10 +152,18 @@ set_source_files_properties(
     PROPERTIES COMPILE_FLAGS
     -Wno-unused-variable
     )
-
-# Temporary suppress "fallthrough" warnings until they are fixed in libsodium repo
 set_source_files_properties(
-    ${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c
-    ${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c
+    ${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c
     PROPERTIES COMPILE_FLAGS
-    -Wno-implicit-fallthrough)
+    -Wno-unknown-pragmas
+    )
+
+# Temporary suppress "fallthrough" warnings until they are fixed in libsodium repo
+if(GCC_NOT_5_2_0)
+    set_source_files_properties(
+        ${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c
+        ${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c
+        PROPERTIES COMPILE_FLAGS
+        -Wno-implicit-fallthrough
+        )
+endif()
\ No newline at end of file
index 068d8a5c4bb94b2387cd47e91591684bd137c86e..794d5bc6a48ac20f1975e70bed3932bca680b206 100644 (file)
@@ -126,3 +126,16 @@ register_component()
 
 # lots of LWIP source files evaluate macros that check address of stack variables
 component_compile_options(-Wno-address)
+
+if(GCC_NOT_5_2_0)
+    set_source_files_properties(
+        lwip/src/netif/ppp/ppp.c
+        PROPERTIES COMPILE_FLAGS
+        -Wno-uninitialized
+        )
+    set_source_files_properties(
+        lwip/src/netif/ppp/pppos.c
+        PROPERTIES COMPILE_FLAGS
+        -Wno-implicit-fallthrough
+        )
+endif()
index cada4eb3cd18407f8118df8fc0feb131f306e1df..1969d3995bb622a2f5486634af861ef469a00de6 100644 (file)
@@ -5,3 +5,7 @@ set(COMPONENT_SRCS "ble_hidd_demo_main.c"
 set(COMPONENT_ADD_INCLUDEDIRS ".")
 
 register_component()
+
+if(GCC_NOT_5_2_0)
+    component_compile_options(-Wno-unused-const-variable)
+endif()