- Make sure lz4 is referenced correctly from CMake and pkgconfig * Add fix_lz4_linkage.patch * Add 0001-Fix-LZ4_LDFLAGS-format-for-pkgconfig-file.patch - Add liblz4 devel dependency - Correct CMake config install patch OBS-URL: https://build.opensuse.org/request/show/1008568 OBS-URL: https://build.opensuse.org/package/show/science/flann?expand=0&rev=10
53 lines
2.3 KiB
Diff
53 lines
2.3 KiB
Diff
From c9572a40574c18a79e50b6a8c0043a8cafed6e69 Mon Sep 17 00:00:00 2001
|
|
From: Maarten de Vries <maarten@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)
|