[packages/flann] upstream fix to cmake files so lz4 is linked in as well; rel 2

atler atler at pld-linux.org
Tue Feb 21 18:49:18 CET 2023


commit 44cd2ddb0f3b99c381c1f205a808533b3d427623
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Feb 21 18:48:26 2023 +0100

    upstream fix to cmake files so lz4 is linked in as well; rel 2
    
    flann's header files contain lz4 code directly

 cmake.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 flann.spec  |  4 +++-
 2 files changed, 55 insertions(+), 1 deletion(-)
---
diff --git a/flann.spec b/flann.spec
index 223289b..9f6ec62 100644
--- a/flann.spec
+++ b/flann.spec
@@ -7,7 +7,7 @@ Summary:	FLANN - Fast Library for Approximate Nearest Neighbours
 Summary(pl.UTF-8):	FLANN - szybka biblioteka do przybliżonego wyszukiwania najbliższych sąsiadów
 Name:		flann
 Version:	1.9.2
-Release:	1
+Release:	2
 License:	BSD
 Group:		Libraries
 #Source0Download: https://github.com/flann-lib/flann/tags
@@ -15,6 +15,7 @@ Source0:	https://github.com/flann-lib/flann/archive/%{version}/%{name}-%{version
 # Source0-md5:	d187585a55676e2b12bbb7ea04d1398f
 Patch0:		%{name}-python.patch
 Patch1:		%{name}-libdir.patch
+Patch2:		cmake.patch
 URL:		https://github.com/flann-lib/flann
 BuildRequires:	cmake >= 2.6
 %{?with_openmp:BuildRequires:	gcc-c++ >= 6:4.2}
@@ -114,6 +115,7 @@ Dowiązania Pythona do biblioteki FLANN.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 install -d build
diff --git a/cmake.patch b/cmake.patch
new file mode 100644
index 0000000..43e1142
--- /dev/null
+++ b/cmake.patch
@@ -0,0 +1,52 @@
+From c9572a40574c18a79e50b6a8c0043a8cafed6e69 Mon Sep 17 00:00:00 2001
+From: Maarten de Vries <maarten at de-vri.es>
+Date: Mon, 18 Oct 2021 10:56:42 +0200
+Subject: [PATCH] Ensure LZ4 is added to the interface link libraries of shared
+ libraries.
+
+---
+ src/cpp/CMakeLists.txt | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
+index 10135703..a75059f9 100644
+--- a/src/cpp/CMakeLists.txt
++++ b/src/cpp/CMakeLists.txt
+@@ -9,7 +9,7 @@ file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
+ file(GLOB_RECURSE CU_SOURCES *.cu)
+ 
+ add_library(flann_cpp_s STATIC ${CPP_SOURCES})
+-target_link_libraries(flann_cpp_s ${LZ4_LINK_LIBRARIES})
++target_link_libraries(flann_cpp_s PUBLIC ${LZ4_LINK_LIBRARIES})
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+     set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC)
+ endif()
+@@ -33,6 +33,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+     add_library(flann_cpp SHARED dummy.c)
+     set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
+     target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)
++    target_link_libraries(flann_cpp PUBLIC ${LZ4_LINK_LIBRARIES})
+ 
+     if (BUILD_CUDA_LIB)
+ 	cuda_add_library(flann_cuda SHARED dummy.c)
+@@ -42,7 +43,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+     endif()
+ else()
+     add_library(flann_cpp SHARED ${CPP_SOURCES})
+-    target_link_libraries(flann_cpp ${LZ4_LINK_LIBRARIES})
++    target_link_libraries(flann_cpp PUBLIC ${LZ4_LINK_LIBRARIES})
+     # export lz4 headers, so that MSVC to creates flann_cpp.lib
+     set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
+     if (BUILD_CUDA_LIB)
+@@ -90,9 +91,10 @@ if (BUILD_C_BINDINGS)
+         add_library(flann SHARED dummy.c)
+         set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
+         target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive)
++        target_link_libraries(flann PUBLIC ${LZ4_LINK_LIBRARIES})
+     else()
+         add_library(flann SHARED ${C_SOURCES})
+-        target_link_libraries(flann ${LZ4_LINK_LIBRARIES})
++        target_link_libraries(flann PUBLIC ${LZ4_LINK_LIBRARIES})
+ 
+         if(MINGW AND OPENMP_FOUND)
+           target_link_libraries(flann gomp)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/flann.git/commitdiff/44cd2ddb0f3b99c381c1f205a808533b3d427623



More information about the pld-cvs-commit mailing list