build: use -ffunction-sections and --gc-sections
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 13 Jun 2014 13:26:37 +0000 (15:26 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 13 Jun 2014 13:26:37 +0000 (15:26 +0200)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
CMakeLists.txt

index 22042e18470bebb40793cab54390699d9f62dfaa..ef1a089ab796a7aae85d4dc7eb5bc9c5f9dbd2cb 100644 (file)
@@ -1,9 +1,9 @@
 cmake_minimum_required(VERSION 2.6)
 
 PROJECT(jsonpath C)
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations)
+ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -ffunction-sections)
 
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
+SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,--gc-sections")
 
 IF(APPLE)
   INCLUDE_DIRECTORIES(/opt/local/include)