From c234838635e7abbd57cf9c11afb7f5d3a0932f50 Mon Sep 17 00:00:00 2001 From: Sean Du Date: Mon, 22 Jun 2026 08:08:03 +0800 Subject: [PATCH] Reduce helper binary size Signed-off-by: Sean Du --- CMakeLists.txt | 7 +++++++ Makefile | 1 + 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 426e899..ff90546 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,3 +80,10 @@ if(MINGW) "-static-libstdc++" ) endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Release") + target_link_options(cgss-borderless-helper PRIVATE + "-Wl,--gc-sections" + "-s" + ) +endif() diff --git a/Makefile b/Makefile index 4c068e1..97ad091 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ else CFLAGS += -O2 -ffunction-sections -fdata-sections CXXFLAGS += -O2 -ffunction-sections -fdata-sections LDFLAGS += -Wl,--gc-sections -s + HELPER_LDFLAGS += -Wl,--gc-sections -s endif C_SRCS := \