godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Add lto scons option

Open Ivorforce opened this issue 1 year ago • 2 comments

The behavior mimics almost the exact behavior (minus "progress" options) of Godot scons:

This is an active change (edit: not anymore, defaults to 'none' by default now): Once merged, all projects depending on godot-cpp (and updating the submodule) will gain LTO for release builds. I tested a similar setup in my own project, not the exact same though (because I don't have all combinations of windows, msvc, mingw and use_llvm available). However, since that it mimics what Godot does already, it should be good, given I did not make mistakes.

One important difference is that in my implementation (edit: not anymore, consistently 'none' by default now), "auto" is consistent across platforms ("full" in production, "none" in dev). I saw small, but consistent gains in all platforms, and don't see why LTO should be avoided in some platforms by default.

Ivorforce avatar Sep 21 '24 10:09 Ivorforce

Not sure why the windows builds are failing. I don't have this problem with any of my git runners. If this is related to the PR, we can default to no LTO on windows. Let me know what you think.

Ivorforce avatar Sep 21 '24 16:09 Ivorforce

Code-wise, this seems to be getting there!

However:

  1. It'd be great if @Faless could give it one last review, and
  2. This will need to be squashed into a single commit before it can be merged - see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#the-interactive-rebase

dsnopek avatar Oct 05 '24 17:10 dsnopek

Right, i forgot to change the final commit message after the changes. Should be good now!

Ivorforce avatar Nov 12 '24 11:11 Ivorforce

Thanks!

dsnopek avatar Nov 12 '24 17:11 dsnopek

Cherry-picked for 4.2 in PR https://github.com/godotengine/godot-cpp/pull/1694

dsnopek avatar Jan 27 '25 22:01 dsnopek

Cherry-picked for 4.3 in PR https://github.com/godotengine/godot-cpp/pull/1695

dsnopek avatar Jan 27 '25 23:01 dsnopek