Open bansan85 opened 2 months ago
f33f6afb667b6b5c0da7dee98dc02f51b4cc0e96
I want to enable lto in Release mode only. I added set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) in my CMakeLists.txt.
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
CMakeLists.txt
Since I didn't set CMAKE_INTERPROCEDURAL_OPTIMIZATION, line https://github.com/pybind/pybind11/blob/f33f6afb667b6b5c0da7dee98dc02f51b4cc0e96/tools/pybind11Common.cmake#L397 think I didn't already enabled -flto=thin and add -flto. So when building in Release mode, I have : -flto=thin -flto.
CMAKE_INTERPROCEDURAL_OPTIMIZATION
-flto=thin
-flto
-flto=thin -flto
I bypass the problem by setting THIN_LTO in pybind11_add_module.
THIN_LTO
pybind11_add_module
No response
Not a regression
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
f33f6afb667b6b5c0da7dee98dc02f51b4cc0e96
Problem description
I want to enable lto in Release mode only. I added
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
in myCMakeLists.txt
.Since I didn't set
CMAKE_INTERPROCEDURAL_OPTIMIZATION
, line https://github.com/pybind/pybind11/blob/f33f6afb667b6b5c0da7dee98dc02f51b4cc0e96/tools/pybind11Common.cmake#L397 think I didn't already enabled-flto=thin
and add-flto
. So when building in Release mode, I have :-flto=thin -flto
.I bypass the problem by setting
THIN_LTO
inpybind11_add_module
.Reproducible example code
No response
Is this a regression? Put the last known working version here if it is.
Not a regression