package/opencv: Do not add libdl to LINKER_LIBS for static builds
[buildroot-gz.git] / package / opencv / 0004-CMakeLists.txt-Do-not-add-libdl-to-LINKER_LIBS-for-s.patch
blob6d63411b015a2cdd2dc9d1cb336e3b96c5430e95
1 From 22e03ef8a9e3adcbc6b2f16c3cc98e4e14443eed Mon Sep 17 00:00:00 2001
2 From: Bernd Kuhls <bernd.kuhls@t-online.de>
3 Date: Sat, 24 Sep 2016 17:51:22 +0200
4 Subject: [PATCH 1/1] CMakeLists.txt: Do not add libdl to LINKER_LIBS for
5 static builds
7 Without this patch -ldl is present in opencv.pc which breaks OpenCV
8 detection by ffmpeg, detected by buildroot autobuilders:
10 http://autobuild.buildroot.net/results/765/7657e01481995a4f0d725467e935a83928a59a04//ffmpeg-3.1.3/config.log
12 /home/peko/autobuild/instance-1/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.9.4/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -ldl
14 Patch sent upstream: https://github.com/opencv/opencv/pull/7337
16 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
17 ---
18 CMakeLists.txt | 5 ++++-
19 1 file changed, 4 insertions(+), 1 deletion(-)
21 diff --git a/CMakeLists.txt b/CMakeLists.txt
22 index 007b80d..99b047d 100644
23 --- a/CMakeLists.txt
24 +++ b/CMakeLists.txt
25 @@ -457,7 +457,10 @@ if(UNIX)
26 elseif(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
27 set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m)
28 else()
29 - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
30 + if(BUILD_SHARED_LIBS)
31 + set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl)
32 + endif()
33 + set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread rt)
34 endif()
35 else()
36 set(HAVE_LIBPTHREAD YES)
37 --
38 2.9.3