net-wireless/airspyhf: Add static-libs use flag

Closes: https://bugs.gentoo.org/934412
Signed-off-by: Eli Burch <eli.burch@burchbytes.com>
This commit is contained in:
Eli Burch
2024-06-16 17:42:13 -07:00
parent 669b5ef816
commit cb7f344f48
2 changed files with 46 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="udev"
IUSE="udev static-libs"
DEPEND="dev-libs/libusb"
@@ -26,6 +26,8 @@ BDEPEND="virtual/pkgconfig"
src_prepare(){
sed -i "s@DESTINATION \"/etc/udev/rules.d\"@DESTINATION \"$(get_udevdir)/rules.d\"@" "tools/CMakeLists.txt" || die
use static-libs || eapply "${FILESDIR}/static.patch" || die
cmake_src_prepare
}

View File

@@ -0,0 +1,43 @@
diff --git a/libairspyhf/src/CMakeLists.txt b/libairspyhf/src/CMakeLists.txt
index 9d8d483..38d1b24 100644
--- a/libairspyhf/src/CMakeLists.txt
+++ b/libairspyhf/src/CMakeLists.txt
@@ -46,16 +46,7 @@ add_library(airspyhf SHARED ${c_sources} ${AIRSPYHF_DLL_SRCS})
set_target_properties(airspyhf PROPERTIES VERSION ${AIRSPYHF_VER_MAJOR}.${AIRSPYHF_VER_MINOR}.${AIRSPYHF_VER_REVISION})
set_target_properties(airspyhf PROPERTIES SOVERSION 0)
-# Static library
-add_library(airspyhf-static STATIC ${c_sources})
-if(MSVC)
- set_target_properties(airspyhf-static PROPERTIES OUTPUT_NAME "airspyhf_static")
-else()
- set_target_properties(airspyhf-static PROPERTIES OUTPUT_NAME "airspyhf")
-endif()
-
set_target_properties(airspyhf PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-set_target_properties(airspyhf-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# Dependencies
target_link_libraries(airspyhf ${LIBUSB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
@@ -71,10 +62,6 @@ if( ${UNIX} )
LIBRARY DESTINATION lib${LIB_SUFFIX}
COMPONENT sharedlibs
)
- install(TARGETS airspyhf-static
- ARCHIVE DESTINATION lib${LIB_SUFFIX}
- COMPONENT staticlibs
- )
install(FILES ${c_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT headers
@@ -86,10 +73,6 @@ if( ${WIN32} )
DESTINATION bin
COMPONENT sharedlibs
)
- install(TARGETS airspyhf-static
- DESTINATION bin
- COMPONENT staticlibs
- )
install(FILES ${c_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT headers