diff options
author | pacien | 2018-06-03 22:26:13 +0200 |
---|---|---|
committer | pacien | 2018-06-03 22:26:13 +0200 |
commit | 690103af73ee06954250c9ae6e48840a7827a8e7 (patch) | |
tree | 3097de79b093ee1ab99da5c44173d8d09794352c /app/CMakeLists.txt | |
parent | 2579b90104b8b6464a1adafee7b251e15652b57f (diff) | |
download | tincapp-690103af73ee06954250c9ae6e48840a7827a8e7.tar.gz |
Enable binary size optimisations
Diffstat (limited to 'app/CMakeLists.txt')
-rw-r--r-- | app/CMakeLists.txt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 3cba6fa..7f90c2c 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt | |||
@@ -1,6 +1,9 @@ | |||
1 | cmake_minimum_required(VERSION 3.4.1) | 1 | cmake_minimum_required(VERSION 3.4.1) |
2 | include(ExternalProject) | 2 | include(ExternalProject) |
3 | 3 | ||
4 | set(CC_OPTIMISATION_FLAGS "-ffunction-sections -fdata-sections") | ||
5 | set(LD_OPTIMISATION_FLAGS "-Wl,--gc-sections") | ||
6 | |||
4 | set(xCONFIG | 7 | set(xCONFIG |
5 | "CC=${CMAKE_C_COMPILER} \ | 8 | "CC=${CMAKE_C_COMPILER} \ |
6 | ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} \ | 9 | ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} \ |
@@ -9,8 +12,8 @@ set(xCONFIG | |||
9 | "LD=${CMAKE_LINKER}" | 12 | "LD=${CMAKE_LINKER}" |
10 | "AR=${CMAKE_AR}" | 13 | "AR=${CMAKE_AR}" |
11 | "RANLIB=${CMAKE_RANLIB}" | 14 | "RANLIB=${CMAKE_RANLIB}" |
12 | "CFLAGS=${CMAKE_C_FLAGS}" | 15 | "CFLAGS=${CMAKE_C_FLAGS} ${CC_OPTIMISATION_FLAGS}" |
13 | "LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}" | 16 | "LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS} ${LD_OPTIMISATION_FLAGS}" |
14 | "--host=${CMAKE_C_COMPILER_TARGET}" | 17 | "--host=${CMAKE_C_COMPILER_TARGET}" |
15 | ) | 18 | ) |
16 | 19 | ||