From b2db28a19d2eab451301fcc93b547db5dd9bae14 Mon Sep 17 00:00:00 2001 From: "Tom M." Date: Sun, 22 Dec 2024 00:16:39 +0100 Subject: [PATCH] -fopt-info --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0d535bb5..519566372 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,8 +221,11 @@ if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_C else () # not intel # gcc and clang support bad function cast and alignment warnings; add them as well. set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast -Wcast-align" ) - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopt-info -Wcast-align" ) - + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align" ) + + if ( CMAKE_COMPILER_IS_GNUCXX ) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopt-info" ) + endif() if ( enable-ubsan ) set ( CMAKE_C_FLAGS "-fsanitize=address,undefined ${CMAKE_C_FLAGS}" ) set ( CMAKE_CXX_FLAGS "-fsanitize=address,undefined ${CMAKE_CXX_FLAGS}" )