Browse Source

Fix bug #55964: CMake's `LWIP_COMPILER_FLAGS` should be split for C and C++

CMakeCommon.cmake: Use conditional for flags that only make sense for C code
Dirk Ziegelmeier 6 years ago
parent
commit
a329bdd607
1 changed files with 5 additions and 5 deletions
  1. 5 5
      contrib/ports/CMakeCommon.cmake

+ 5 - 5
contrib/ports/CMakeCommon.cmake

@@ -53,12 +53,12 @@ set(LWIP_COMPILER_FLAGS_GNU_CLANG
     -Wshadow
     -Wpointer-arith
     -Wcast-qual
-    -Wc++-compat
+     $<$<COMPILE_LANGUAGE:C>:-Wc++-compat>
     -Wwrite-strings
-    -Wold-style-definition
+     $<$<COMPILE_LANGUAGE:C>:-Wold-style-definition>
     -Wcast-align
-    -Wmissing-prototypes
-    -Wnested-externs
+     $<$<COMPILE_LANGUAGE:C>:-Wmissing-prototypes>
+     $<$<COMPILE_LANGUAGE:C>:-Wnested-externs>
     -Wunreachable-code
     -Wuninitialized
     -Wmissing-prototypes
@@ -80,7 +80,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
 
     if (NOT LWIP_HAVE_MBEDTLS)
         list(APPEND LWIP_COMPILER_FLAGS_GNU_CLANG
-            -Wc90-c99-compat
+            $<$<COMPILE_LANGUAGE:C>:-Wc90-c99-compat>
         )
     endif()