From bfb72f1ed31aaf3be4c18b414ddd0df60b270b2d Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Mon, 4 Apr 2016 17:24:57 +0900 Subject: [PATCH] Modify some build optimization options Change-Id: Ie267f821b84c8ad7b3140e69db9663db34ea520c Signed-off-by: Mu-Woong Lee --- CMakeLists.txt | 5 +++-- packaging/context.spec | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 109e9ec..139e2ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,8 @@ INCLUDE(FindPkgConfig) INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ) -ADD_DEFINITIONS(-g -O2 -Wall -fPIC -fvisibility=hidden -Wl,--as-needed) +ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden) +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section") # Building Library pkg_check_modules(api_pkg REQUIRED ${DEPS}) @@ -34,7 +35,7 @@ SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER}) SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER}) # Installing -INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries) +INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}) INSTALL( DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service FILES_MATCHING diff --git a/packaging/context.spec b/packaging/context.spec index bd0219f..a395a4d 100644 --- a/packaging/context.spec +++ b/packaging/context.spec @@ -27,8 +27,8 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` export CFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter" export CXXFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter" -export CFLAGS+=" -Wno-empty-body -fno-omit-frame-pointer -fno-optimize-sibling-calls" -export CXXFLAGS+=" -Wno-empty-body -fno-omit-frame-pointer -fno-optimize-sibling-calls" +export CFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls" +export CXXFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls" export CFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow" export CXXFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow" -- 2.7.4