summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunmin Lee <sunm.lee@samsung.com>2018-01-17 17:36:54 +0900
committerSunmin Lee <sunm.lee@samsung.com>2018-01-17 17:39:15 +0900
commit71bbbf39d5d7f95657e1c6d5681af4d914dfc34f (patch)
treea9279aaa1df0dc0bc4d294341b4d7f2a35156934
parent47dd91d4f31d08dbd7c27ef67bafb49f2fb0444b (diff)
download7zip-accepted/tizen_4.0_unified.tar.gz
7zip-accepted/tizen_4.0_unified.tar.bz2
7zip-accepted/tizen_4.0_unified.zip
From now, 7zip provides static library as well as shared one. Change-Id: I95dbda43a174ef07c27c06d27dba2c17b36dd0c6 Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
-rwxr-xr-xCMakeLists.txt9
-rw-r--r--packaging/7zip.spec3
2 files changed, 11 insertions, 1 deletions
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 $<TARGET_OBJECTS:${PROJECT_NAME}-object>)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+
+ADD_LIBRARY(${PROJECT_NAME}-static STATIC $<TARGET_OBJECTS:${PROJECT_NAME}-object>)
+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