File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/library")
4545# Build Options
4646option (FLB_ALL "Enable all features" No )
4747option (FLB_DEBUG "Build with debug symbols" No )
48+ option (FLB_SMALL "Optimise for small size" No )
4849option (FLB_COVERAGE "Build with code-coverage" No )
4950option (FLB_JEMALLOC "Build with Jemalloc support" No )
5051option (FLB_REGEX "Build with Regex support" Yes )
@@ -223,6 +224,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
223224 endif ()
224225endif ()
225226
227+ if (FLB_SMALL)
228+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -g0 -s -fno-stack-protector -fomit-frame-pointer -DNDEBUG" )
229+ endif ()
230+
226231if (FLB_COVERAGE)
227232 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage" )
228233 set (CMAKE_BUILD_TYPE "Debug" )
Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ endif()
1919
2020# Onigmo (UNIX)
2121# =============
22+ if (FLB_SMALL)
23+ ExternalProject_Add(onigmo
24+ BUILD_IN_SOURCE TRUE
25+ EXCLUDE_FROM_ALL TRUE
26+ SOURCE_DIR ${ONIGMO_SRC}
27+ INSTALL_DIR ${ONIGMO_DEST}
28+ CONFIGURE_COMMAND ./configure ${AUTOCONF_HOST_OPT} --with-pic --disable-shared --enable-static --prefix =${ONIGMO_DEST}
29+ CFLAGS=-std=gnu99\ -Wall\ -pipe\ -Os\ -g0\ -s\ -fno-stack-protector\ -fomit-frame-pointer\ -DNDEBUG
30+ BUILD_COMMAND $(MAKE)
31+ INSTALL_COMMAND $(MAKE) install )
32+ else ()
2233ExternalProject_Add(onigmo
2334 BUILD_IN_SOURCE TRUE
2435 EXCLUDE_FROM_ALL TRUE
@@ -28,6 +39,7 @@ ExternalProject_Add(onigmo
2839 CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
2940 BUILD_COMMAND $(MAKE)
3041 INSTALL_COMMAND $(MAKE) install )
42+ endif ()
3143
3244# Onigmo (Windows)
3345# ================
You can’t perform that action at this time.
0 commit comments