diff options
author | makise-homura <akemi_homura@kurisa.ch> | 2022-07-06 16:54:30 (GMT) |
---|---|---|
committer | makise-homura <akemi_homura@kurisa.ch> | 2022-07-06 19:43:49 (GMT) |
commit | 28b1c5f9b3cde00c88b7729b96613ff0e51132d9 (patch) | |
tree | 06060d8d523b576e9358ea55b0f1b6f732db2ad5 /CompileFlags.cmake | |
parent | ad2e7f3c537dc88ea8140bab67c43d25695637f1 (diff) | |
download | CMake-28b1c5f9b3cde00c88b7729b96613ff0e51132d9.zip CMake-28b1c5f9b3cde00c88b7729b96613ff0e51132d9.tar.gz CMake-28b1c5f9b3cde00c88b7729b96613ff0e51132d9.tar.bz2 |
LCC: get rid of excess -Wunused-but-set-variable on release builds
LCC, as of 1.26, has a buggy EDG frontend that emits
-Wunused-but-set-variable warning even if there's something
like "(void)var" when frontend optimizations are enabled (>=-O1).
To get rid of this warning, we disable it in CMake's root
CMakeLists.txt for LCC >= 1.26. Later, when this bug will be fixed
in LCC, this version check will have its top version limit.
Diffstat (limited to 'CompileFlags.cmake')
-rw-r--r-- | CompileFlags.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake index e6fb20b..5641de4 100644 --- a/CompileFlags.cmake +++ b/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() |