rive-app / rive-cpp-legacy

C++ runtime for Rive
MIT License
287 stars 43 forks source link

Cleanup builds #268

Closed mikerreed closed 2 years ago

mikerreed commented 2 years ago
csmartdalton commented 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.

mikerreed commented 2 years ago

Does it? My intuition says it is a linker command, and so doesn't apply until that step.

csmartdalton commented 2 years ago

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?

mikerreed commented 2 years ago

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.

mikerreed commented 2 years ago

good catch. updated.