From 5d8b54be7301de604112ce6f7ca33ee01167bf12 Mon Sep 17 00:00:00 2001 From: tqcq Date: Sat, 16 Dec 2023 01:47:47 +0800 Subject: [PATCH] feat add -s for Release --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42e7eaa..0e768c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,11 @@ option(ULIB_SHARED_LIB "Build shared library" OFF) if (NOT CMAKE_BUILD_TYPE) - set(MY_CMAKE_BUILD_TYPE "Release") + set(CMAKE_BUILD_TYPE "Release") + # set stripped + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") endif() +# add -static-libgcc and -static-libstdc++ to link flags set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (ULIB_SHARED_LIB)