summaryrefslogtreecommitdiffstats
path: root/CompileFlags.cmake
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-20 22:00:05 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-22 13:24:46 (GMT)
commita509602699eb83fbbea67244051c8a18f708a6ae (patch)
tree94dc40d7c2f27d428e3e421a079fdb9c74ca29e3 /CompileFlags.cmake
parent914d21de58094d461c9f86738136fb034a691113 (diff)
downloadCMake-a509602699eb83fbbea67244051c8a18f708a6ae.zip
CMake-a509602699eb83fbbea67244051c8a18f708a6ae.tar.gz
CMake-a509602699eb83fbbea67244051c8a18f708a6ae.tar.bz2
Build: Modernize some `foreach` calls to use `IN LISTS`/`IN ITEMS`
Diffstat (limited to 'CompileFlags.cmake')
-rw-r--r--CompileFlags.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 47c8352..acfa29f 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -98,7 +98,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
endif()
endif()
-foreach(lang C CXX)
+foreach(lang IN ITEMS C CXX)
# Suppress warnings from PGI compiler.
if (CMAKE_${lang}_COMPILER_ID STREQUAL "PGI")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
@@ -138,9 +138,9 @@ OFF to disable /MP completely." )
endif()
# Get rid of excess -Wunused-but-set-variable on release builds with LCC >= 1.26
-foreach(l C CXX)
+foreach(l IN ITEMS C CXX)
if(CMAKE_${l}_COMPILER_ID STREQUAL "LCC" AND NOT CMAKE_${l}_COMPILER_VERSION VERSION_LESS 1.26)
- foreach(c MINSIZEREL RELEASE RELWITHDEBINFO)
+ foreach(c IN ITEMS MINSIZEREL RELEASE RELWITHDEBINFO)
string(APPEND "CMAKE_${l}_FLAGS_${c}" " -Wno-unused-but-set-variable")
endforeach()
endif()