diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index 1bcea86c4..df32f9f94 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -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() diff --git a/components/coap/CMakeLists.txt b/components/coap/CMakeLists.txt index 225745e8c..a7800e64f 100644 --- a/components/coap/CMakeLists.txt +++ b/components/coap/CMakeLists.txt @@ -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 diff --git a/components/expat/CMakeLists.txt b/components/expat/CMakeLists.txt index 02037dc21..821705658 100644 --- a/components/expat/CMakeLists.txt +++ b/components/expat/CMakeLists.txt @@ -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 diff --git a/components/libsodium/CMakeLists.txt b/components/libsodium/CMakeLists.txt index 2ed003f13..aa39b0047 100644 --- a/components/libsodium/CMakeLists.txt +++ b/components/libsodium/CMakeLists.txt @@ -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 ) +set_source_files_properties( + ${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c + PROPERTIES COMPILE_FLAGS + -Wno-unknown-pragmas + ) # 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 - PROPERTIES COMPILE_FLAGS - -Wno-implicit-fallthrough) +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 diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 068d8a5c4..794d5bc6a 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -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() diff --git a/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt index cada4eb3c..1969d3995 100644 --- a/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt +++ b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt @@ -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()