mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
Eliminating compilation warnings when using lto in
gcc12 and later versions use -flto=auto when use gcc12 or later Signed-off-by: 不鱼儿 <36976072+buyuer@users.noreply.github.com>
This commit is contained in:
parent
7819ec784b
commit
4ee0f212cc
@ -261,8 +261,12 @@ if(CV_GCC OR CV_CLANG)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LTO)
|
if(ENABLE_LTO)
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
||||||
|
add_extra_compiler_option(-flto=auto)
|
||||||
|
else()
|
||||||
add_extra_compiler_option(-flto)
|
add_extra_compiler_option(-flto)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
if(ENABLE_THIN_LTO)
|
if(ENABLE_THIN_LTO)
|
||||||
add_extra_compiler_option(-flto=thin)
|
add_extra_compiler_option(-flto=thin)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user