From 765e6bb8a078f06bdc01984b3859c5b29496ddeb Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 19 Jul 2024 23:37:28 +0300 Subject: [PATCH] build: add -gc-sections for non-MSVC compilers --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dd55ad..064f445 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,10 @@ else() -fno-trapping-math -freciprocal-math) set(BUILD_FLAGS_RELEASE - -flto) + -flto + -Wl,-gc-sections + -fdata-sections + -ffunction-sections) set(BUILD_FLAGS_DEBUG -g3 -gdwarf