AIX: Disable LTO/IPO with GCC, which does not support it

The GNU compiler does not support LTO on AIX.
This commit is contained in:
Aditya Kamath
2026-08-24 13:52:21 -04:00
committed by Brad King
parent b7b55e306b
commit cff46f99ee
+2 -1
View File
@@ -77,7 +77,8 @@ macro(__compiler_gnu lang)
# '-flto' introduced since GCC 4.5:
# * https://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Option-Summary.html (no)
# * https://gcc.gnu.org/onlinedocs/gcc-4.5.4/gcc/Option-Summary.html (yes)
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.5)
# * It does not support AIX.
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.5 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AIX")
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
set(__lto_flags "")