Closed mikerreed closed 2 years ago
- only set -flto in release builds
Can this affect performance? I originally thought lto didn't have effect on a static lib, but after some googling it seems like that might not be the case.
Does it? My intuition says it is a linker command, and so doesn't apply until that step.
Does it? My intuition says it is a linker command, and so doesn't apply until that step.
That was my intuition too, but there seems to be a lot of discussion around doing this:
https://stackoverflow.com/questions/25878407/how-can-i-use-lto-with-static-libraries https://gitlab.kitware.com/cmake/cmake/-/issues/20818
Is there any harm in just leaving LTO on for the rive library until we have formal performance testing?
https://llvm.org/docs/LinkTimeOptimization.html
Yup, looks like it can take advantage of lto at compile-time. :)
I'm fine to restore it for release builds in our lib.
good catch. updated.