From 867ae377edb385a31d13dabd19477aa764d50b89 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 15 Oct 2015 22:41:25 +0200 Subject: [PATCH] minor CMakeLists.txt tweak: optimize for small binaries even in release builds --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82c0785c..09edbae5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,6 +123,11 @@ elseif (UNIX) # .SO file extension on Linux/Mac OS set_target_properties(example PROPERTIES SUFFIX ".so") + # Optimize for a small binary size + if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG) + set_target_properties(example PROPERTIES COMPILE_FLAGS "-Os") + endif() + # Strip unnecessary sections of the binary on Linux/Mac OS if(APPLE) set_target_properties(example PROPERTIES MACOSX_RPATH ".")