[vlc-commits] contrib: srt: don't force pthread and libc
Steve Lhomme
git at videolan.org
Wed May 16 15:53:21 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed May 16 14:45:54 2018 +0200| [85dc1e8a52bf80bdb30faf930dbd23dad771f89c] | committer: Steve Lhomme
contrib: srt: don't force pthread and libc
Similar to what x265 does. We need to use pthreads-win32 anyway.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=85dc1e8a52bf80bdb30faf930dbd23dad771f89c
---
contrib/src/srt/rules.mak | 3 +++
contrib/src/srt/srt-no-implicit-libs.patch | 26 ++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/contrib/src/srt/rules.mak b/contrib/src/srt/rules.mak
index 61c0544a16..7a9004b55d 100644
--- a/contrib/src/srt/rules.mak
+++ b/contrib/src/srt/rules.mak
@@ -34,6 +34,9 @@ srt: srt-$(SRT_VERSION).tar.gz .sum-srt
$(APPLY) $(SRC)/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
$(APPLY) $(SRC)/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
$(APPLY) $(SRC)/srt/srt-fix-non-gnu-detection.patch
+ifdef HAVE_WIN32
+ $(APPLY) $(SRC)/srt/srt-no-implicit-libs.patch
+endif
$(call pkg_static,"scripts/haisrt.pc.in")
mv srt-$(SRT_VERSION) $@ && touch $@
diff --git a/contrib/src/srt/srt-no-implicit-libs.patch b/contrib/src/srt/srt-no-implicit-libs.patch
new file mode 100644
index 0000000000..928e38f6e5
--- /dev/null
+++ b/contrib/src/srt/srt-no-implicit-libs.patch
@@ -0,0 +1,26 @@
+--- srt-1.2.3/CMakeLists.txt 2018-05-16 15:11:24.490534700 +0200
++++ srt-1.2.3/CMakeLists.txt.no-pthread 2018-05-16 15:12:19.940696200 +0200
+@@ -423,13 +423,20 @@ endif()
+ # obtained by `pkg-config --libs`.
+
+ message("Adding the following implicit link libraries: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
+-foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
++foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
+ if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
+- set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
++ list(APPEND PLIBLIST "${LIB}")
+ else()
+- set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} "-l${LIB}")
++ list(APPEND PLIBLIST "-l${LIB}")
+ endif()
+ endforeach()
++if(PLIBLIST)
++ # blacklist of libraries that should not be in Libs.private
++ list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread")
++ string(REPLACE ";" " " SRT_LIBS_PRIVATE "${PLIBLIST}")
++else()
++ set(SRT_LIBS_PRIVATE "")
++endif(PLIBLIST)
+
+ join_arguments(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE})
+
More information about the vlc-commits
mailing list