Add static build for capi-system-info 18/319618/1 accepted/tizen/unified/20250304.070215 accepted/tizen/unified/x/20250304.080626
authorGrzegorz Nowakowski <g.nowakowski@samsung.com>
Mon, 3 Feb 2025 09:31:31 +0000 (10:31 +0100)
committerGrzegorz Nowakowski <g.nowakowski@samsung.com>
Mon, 3 Feb 2025 09:31:31 +0000 (10:31 +0100)
Change-Id: Ib448143ce8b4f903912149ebc0ac1ff96bdbb76b

CMakeLists.txt
packaging/capi-system-info.spec

index 8b77e6f65c7ae3bf28e843ee7de9c485e0cab7c8..6009fe1e275e501fc68b12fcaae401295bebaee4 100644 (file)
@@ -69,7 +69,19 @@ SET_TARGET_PROPERTIES(${fw_name}
      CLEAN_DIRECT_OUTPUT 1
 )
 
+ADD_LIBRARY(${fw_name}_static STATIC ${SOURCES})
+SET_TARGET_PROPERTIES(${fw_name}_static
+     PROPERTIES
+     VERSION ${FULLVER}
+     SOVERSION ${MAJORVER}
+     OUTPUT_NAME ${fw_name}
+     LINK_SEARCH_START_STATIC ON
+     LINK_SEARCH_END_STATIC ON
+)
+
 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${fw_name}_static DESTINATION ${LIB_INSTALL_DIR})
+
 INSTALL(
         DIRECTORY ${INC_DIR}/ DESTINATION include/system
         FILES_MATCHING
index c9aa5a5068c6138757b74fadafc0523fce5e4f44..7a9e270f7a58c9cfb9934b0af99cff6bc6dc188c 100644 (file)
@@ -1,3 +1,4 @@
+%define keepstatic yes
 Name:           capi-system-info
 Version:        0.5.2
 Release:        1
@@ -28,6 +29,13 @@ Requires: %{name} = %{version}-%{release}
 
 %description devel
 
+%package devel-static
+Summary:  A System Information static library in Core API (Development)
+Group:    Development/System
+Requires: %{name} = %{version}-%{release}
+
+%description devel-static
+
 %package test
 Summary:  System-info test package
 Group:    Development/System
@@ -149,6 +157,9 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/libcapi-system-info.so
 
+%files devel-static
+%{_libdir}/libcapi-system-info.a
+
 %files test
 # Init DB test
 %{_bindir}/system_info_init_db_test