Skip to content

Commit 580494c

Browse files
authored
fix: LTO warning of gcc >= 11.4 (#5791)
lto-wrapper: warning: using serial compilation of n LTRANS jobs https://stackoverflow.com/questions/72218980/gcc-v12-1-warning-about-serial-compilation
1 parent 6292b70 commit 580494c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/pybind11Common.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ function(_pybind11_generate_lto target prefer_thin_lto)
363363
PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
364364
endif()
365365
if(NOT HAS_FLTO_THIN)
366+
_pybind11_return_if_cxx_and_linker_flags_work(
367+
HAS_FLTO_AUTO "-flto=auto${cxx_append}" "-flto=auto${linker_append}"
368+
PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
369+
endif()
370+
if(NOT HAS_FLTO_AUTO)
366371
_pybind11_return_if_cxx_and_linker_flags_work(
367372
HAS_FLTO "-flto${cxx_append}" "-flto${linker_append}" PYBIND11_LTO_CXX_FLAGS
368373
PYBIND11_LTO_LINKER_FLAGS)

0 commit comments

Comments
 (0)