From: Sunmin Lee Date: Wed, 17 Jan 2018 08:36:54 +0000 (+0900) Subject: Provide static library of 7zip X-Git-Tag: submit/tizen_4.0/20180123.063624 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2F7zip.git;a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen_4.0%2F20180123.063624 Provide static library of 7zip From now, 7zip provides static library as well as shared one. Change-Id: I95dbda43a174ef07c27c06d27dba2c17b36dd0c6 Signed-off-by: Sunmin Lee --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ca7e3e3..fc7eede 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,13 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc DESTINATION ${LIB_INSTAL INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/C) INSTALL(FILES ${HEADERS} DESTINATION include/${PROJECT_NAME}) -ADD_LIBRARY(${PROJECT_NAME} SHARED ${LIB7ZIP_SRCS}) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +ADD_LIBRARY(${PROJECT_NAME}-object OBJECT ${LIB7ZIP_SRCS}) + +ADD_LIBRARY(${PROJECT_NAME} SHARED $) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) + +ADD_LIBRARY(${PROJECT_NAME}-static STATIC $) +SET_TARGET_PROPERTIES(${PROJECT_NAME}-static PROPERTIES VERSION ${VERSION}) +INSTALL(TARGETS ${PROJECT_NAME}-static DESTINATION ${LIB_INSTALL_DIR}) diff --git a/packaging/7zip.spec b/packaging/7zip.spec index 59cf796..10278d4 100644 --- a/packaging/7zip.spec +++ b/packaging/7zip.spec @@ -9,6 +9,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: cmake +%define keepstatic 1 + %description 7-Zip is a file archiver with a high compression ratio. @@ -45,4 +47,5 @@ rm -rf %{buildroot} %defattr(-,root,root,-) %{_includedir}/7zip/*.h %{_libdir}/lib7zip.so +%{_libdir}/lib7zip-static.a %{_libdir}/pkgconfig/lib7zip.pc