[script] add IPO warning flags

This commit is contained in:
tangxifan 2022-08-24 16:48:19 -07:00
parent 665d0dadec
commit c8d02f0a09
1 changed files with 15 additions and 0 deletions

View File

@ -171,6 +171,21 @@ foreach (flag ${WARN_FLAGS_TO_CHECK})
set (WARN_FLAGS "${WARN_FLAGS} ${flag}")
endif()
endforeach()
#Suppress IPO link warnings
set(IPO_LINK_WARN_SUPRESS_FLAGS " ")
set(IPO_LINK_WARN_SUPRESS_FLAGS_TO_CHECK
"-Wno-null-dereference"
)
foreach(flag ${IPO_LINK_WARN_SUPRESS_FLAGS_TO_CHECK})
CHECK_CXX_COMPILER_FLAG(${flag} CXX_COMPILER_SUPPORTS_${flag})
if(CXX_COMPILER_SUPPORTS_${flag})
#Flag supported, so enable it
set(IPO_LINK_WARN_SUPRESS_FLAGS "${IPO_LINK_WARN_SUPRESS_FLAGS} ${flag}")
endif()
endforeach()
#
# Sanitizer flags
#