summaryrefslogtreecommitdiffstats
path: root/vlc/build/patches/srt_add_implicit_link_libraries.patch
blob: 808a9b0d0499052098fdfcc458092f44c1576c62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Source: http://git.videolan.org/?p=vlc/vlc-3.0.git;a=blob;f=contrib/src/srt/add-implicit-link-libraries.patch
srt: add implicit link libraries

+++ srt/CMakeLists.txt	2017-12-09 09:18:38.000000000 +0100
@@ -425,13 +425,15 @@
 # This may cause trouble when you want to compile your app with static libstdc++;
 # if your build requires it, you'd probably remove -lstdc++ from the list
 # obtained by `pkg-config --libs`.
-#
-# Some sensible solution for that is desired. Currently turned on only on demand.
-if (ENABLE_C_DEPS)
-if ( LINUX )
-	set (IFNEEDED_SRT_LDFLAGS "${IFNEEDED_SRT_LDFLAGS} -lstdc++ -lm")
-endif()
-endif()
+
+message("Adding the following implicit link libraries: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
+foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
+    if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
+	    set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
+    else()
+        set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} "-l${LIB}")
+    endif()
+endforeach()
 
 join_arguments(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE})