summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2024-08-21 18:46:42 (GMT)
committerBrad King <brad.king@kitware.com>2024-08-26 14:03:41 (GMT)
commitb2dc1bd1498dc47fa1d611813c6983921eb6a71b (patch)
tree4cff6a3e93d7ad63be841749d7b32bd47af72645
parent1a846c8849c47f5871afaed68468de26d49af29e (diff)
downloadCMake-b2dc1bd1498dc47fa1d611813c6983921eb6a71b.zip
CMake-b2dc1bd1498dc47fa1d611813c6983921eb6a71b.tar.gz
CMake-b2dc1bd1498dc47fa1d611813c6983921eb6a71b.tar.bz2
CMake: Suppress IBM XL optimization warning
`xlC` now warns "Additional optimization may be attained by recompiling and specifying MAXMEM option" on `cmExportPackageInfoGenerator`. Add the suggested option.
-rw-r--r--CompileFlags.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index f94e079..3080daa 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -37,7 +37,13 @@ elseif(_CLANG_MSVC_WINDOWS AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUA
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Xlinker -stack:20000000")
endif()
-#silence duplicate symbol warnings on AIX
+# Silence "Additional optimization may be attained by recompiling and
+# specifying MAXMEM option" warning on XLC (AIX)
+if(CMAKE_CXX_COMPILER_ID MATCHES "^(XL|XLClang)$")
+ string(APPEND CMAKE_CXX_FLAGS " -qmaxmem=-1")
+endif()
+
+# Silence duplicate symbol warnings on AIX
if(CMAKE_SYSTEM_NAME MATCHES "AIX")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")