Use new premake lto api if available

Premake v5.0.0-beta4 replaces the LinkTimeOptimization flag with a
function linktimeoptimization, use it if available to avoid deprecation
warning.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-01-06 21:20:53 +01:00
parent 84b407aa35
commit df38d4e899
No known key found for this signature in database

View file

@ -209,7 +209,12 @@ function project_set_build_flags()
optimize "Speed"
end
if _OPTIONS["with-lto"] then
flags { "LinkTimeOptimization" }
if linktimeoptimization then
linktimeoptimization("On")
else
-- deprecated since v5.0.0-beta4
flags { "LinkTimeOptimization" }
end
end
defines { "NDEBUG", "CONFIG_FINAL=1" }