Browse Source

Merge topic 'lcc-warningless-release-build-with-flag'

28b1c5f9b3 LCC: get rid of excess -Wunused-but-set-variable on release builds

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !7460
Brad King 3 years ago
parent
commit
18eeb51ebb
1 changed files with 9 additions and 0 deletions
  1. 9 0
      CompileFlags.cmake

+ 9 - 0
CompileFlags.cmake

@@ -136,3 +136,12 @@ OFF to disable /MP completely." )
     endif()
   endif()
 endif()
+
+# Get rid of excess -Wunused-but-set-variable on release builds with LCC >= 1.26
+foreach(l C CXX)
+  if(CMAKE_${l}_COMPILER_ID STREQUAL "LCC" AND NOT CMAKE_${l}_COMPILER_VERSION VERSION_LESS 1.26)
+    foreach(c MINSIZEREL RELEASE RELWITHDEBINFO)
+      string(APPEND "CMAKE_${l}_FLAGS_${c}" " -Wno-unused-but-set-variable")
+    endforeach()
+  endif()
+endforeach()