From ea1035a275fcc632479c08fcf73ba51e081aa0b9 Mon Sep 17 00:00:00 2001 From: Grzegorz Nowakowski Date: Mon, 3 Feb 2025 10:31:31 +0100 Subject: [PATCH] Add static build for capi-system-info Change-Id: Ib448143ce8b4f903912149ebc0ac1ff96bdbb76b --- CMakeLists.txt | 12 ++++++++++++ packaging/capi-system-info.spec | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b77e6f..6009fe1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/packaging/capi-system-info.spec b/packaging/capi-system-info.spec index c9aa5a5..7a9e270 100644 --- a/packaging/capi-system-info.spec +++ b/packaging/capi-system-info.spec @@ -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 -- 2.34.1