mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 18:50:16 +03:00
Add optional LTO and harden Windows clipboard handling
- add --with-lto support to Premake 4 and 5 release builds - use ThinLTO with Clang, automatic LTO with GCC, and LTCG with MSVC - exclude Emscripten builds from LTO configuration - retry SDL2 clipboard writes on Windows when the clipboard is temporarily unavailable - make the UIMergeView copy regression test independent of the system clipboard
This commit is contained in:
@@ -51,6 +51,7 @@ newoption {
|
||||
description = "Set the shared data directory",
|
||||
}
|
||||
newoption { trigger = "with-static-cpp", description = "Builds statically libstdc++" }
|
||||
newoption { trigger = "with-lto", description = "Enables Link-Time Optimization for release builds." }
|
||||
|
||||
function is_arm64_arch()
|
||||
local arch = _OPTIONS["arch"]
|
||||
@@ -714,6 +715,21 @@ function parse_args()
|
||||
if _OPTIONS["time-trace"] then
|
||||
buildoptions { "-ftime-trace" }
|
||||
end
|
||||
|
||||
if _OPTIONS["with-lto"] then
|
||||
filter { "configurations:release*", "toolset:gcc", "not system:emscripten" }
|
||||
buildoptions { "-flto=auto" }
|
||||
linkoptions { "-flto=auto" }
|
||||
|
||||
filter { "configurations:release*", "toolset:clang", "not system:emscripten" }
|
||||
buildoptions { "-flto=thin" }
|
||||
linkoptions { "-flto=thin" }
|
||||
|
||||
filter { "configurations:release*", "toolset:msc" }
|
||||
linktimeoptimization "On"
|
||||
|
||||
filter {}
|
||||
end
|
||||
end
|
||||
|
||||
function add_static_links()
|
||||
|
||||
Reference in New Issue
Block a user