From b2dc1bd1498dc47fa1d611813c6983921eb6a71b Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Wed, 21 Aug 2024 14:46:42 -0400 Subject: [PATCH] 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. --- CompileFlags.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CompileFlags.cmake b/CompileFlags.cmake index f94e079ad7..3080daae83 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 ")