The library is only being used by contextd, thus it does not need to be a shared object.
Change-Id: I8005d50fe12d719d7ae447215a3827d79a5382bb
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/include
)
-ADD_DEFINITIONS(-g -O2 -Wall -fPIC -Wl,--as-needed)
+ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections)
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
# Install
INSTALL(
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(alarm-service)
+%define keepstatic 1
+
%description
Context-Service Shared Library
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"
%files devel
%defattr(-,root,root,-)
%{_includedir}/context-service/internal/*.h
+%{_libdir}/libctx-server.a
%{_libdir}/pkgconfig/*.pc
SET(LIB_EXTRA_CFLAGS "${LIB_EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-ADD_LIBRARY(${target} SHARED ${SRCS})
+ADD_LIBRARY(${target} STATIC ${SRCS})
TARGET_LINK_LIBRARIES(${target} ${lib_pkg_LDFLAGS})
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${LIB_EXTRA_CFLAGS})
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT\"")
SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
-INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
SET(PC_NAME "libcontext-server")
SET(VERSION ${FULLVER})
SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
-INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
SET(PC_NAME "libcontext-shared")
SET(VERSION ${FULLVER})