mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #23991 from buyuer:4.x
Eliminating compilation warnings when using lto in gcc12 and later versions
This commit is contained in:
commit
0519e05432
@ -261,8 +261,12 @@ if(CV_GCC OR CV_CLANG)
|
||||
endif()
|
||||
|
||||
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)
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_THIN_LTO)
|
||||
add_extra_compiler_option(-flto=thin)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user