[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: zlib: disable building examples

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Sep 30 15:34:50 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
cc0c26ab by Steve Lhomme at 2022-09-30T14:41:07+00:00
contrib: zlib: disable building examples

Hopefully this should fix the odd emscripten random build failure.

- - - - -
1419660b by Steve Lhomme at 2022-09-30T14:41:07+00:00
contrib: zlib: only use the proper libz name for the static library

We don't care about the dynamic library. It should not pollute our build with a
similar name.

- - - - -


3 changed files:

- contrib/src/zlib/0001-Fix-mingw-static-library-name-on-mingw.patch → contrib/src/zlib/0001-Fix-mingw-static-library-name-on-mingw-and-Emscripte.patch
- + contrib/src/zlib/0002-Add-an-option-to-enable-disable-building-examples.patch
- contrib/src/zlib/rules.mak


Changes:

=====================================
contrib/src/zlib/0001-Fix-mingw-static-library-name-on-mingw.patch → contrib/src/zlib/0001-Fix-mingw-static-library-name-on-mingw-and-Emscripte.patch
=====================================
@@ -1,21 +1,21 @@
-From 7ee28d63afbfd9d87bf8976cfe8f84ca8bbe49a2 Mon Sep 17 00:00:00 2001
+From d923a126c8d3d2c94513d6fd05a1c6248c9c6bf9 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 9 Sep 2022 10:19:56 +0200
-Subject: [PATCH] Fix mingw static library name on mingw
+Subject: [PATCH 1/2] Fix mingw static library name on mingw and Emscripten
 
-mingw builds code in a UNIX like environment but CMake doesn't set UNIX for it.
+They build code in a UNIX like environment but CMake doesn't set UNIX for it.
 ---
  CMakeLists.txt | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e6fbb37..3fa3046 100644
+index e6fbb37..bb9a76d 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -199,10 +199,10 @@ if(NOT CYGWIN)
      set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
  endif()
-
+ 
 -if(UNIX)
 +if(UNIX OR MINGW OR EMSCRIPTEN)
      # On unix-like platforms the library is almost always called libz
@@ -25,6 +25,6 @@ index e6fbb37..3fa3046 100644
       set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
     endif()
  elseif(BUILD_SHARED_LIBS AND WIN32)
---
+-- 
 2.37.3.windows.1
 


=====================================
contrib/src/zlib/0002-Add-an-option-to-enable-disable-building-examples.patch
=====================================
@@ -0,0 +1,37 @@
+From f12a2840ccb937d695d8a0db26c76d2f642525cf Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 29 Sep 2022 06:32:21 +0200
+Subject: [PATCH 2/2] Add an option to enable/disable building examples
+
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bb9a76d..c08ac3f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,6 +7,7 @@ set(VERSION "1.2.12")
+ 
+ option(ASM686 "Enable building i686 assembly implementation")
+ option(AMD64 "Enable building amd64 assembly implementation")
++option(BUILD_EXAMPLES "Build examples" ON)
+ 
+ set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
+ set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
+@@ -230,6 +231,7 @@ endif()
+ # Example binaries
+ #============================================================================
+ 
++if(BUILD_EXAMPLES)
+ add_executable(example test/example.c)
+ target_link_libraries(example zlib)
+ add_test(example example)
+@@ -247,3 +249,4 @@ if(HAVE_OFF64_T)
+     target_link_libraries(minigzip64 zlib)
+     set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+ endif()
++endif(BUILD_EXAMPLES)
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/zlib/rules.mak
=====================================
@@ -14,12 +14,15 @@ $(TARBALLS)/zlib-$(ZLIB_VERSION).tar.gz:
 
 zlib: zlib-$(ZLIB_VERSION).tar.gz .sum-zlib
 	$(UNPACK)
-	$(APPLY) $(SRC)/zlib/0001-Fix-mingw-static-library-name-on-mingw.patch
+	$(APPLY) $(SRC)/zlib/0001-Fix-mingw-static-library-name-on-mingw-and-Emscripte.patch
+	$(APPLY) $(SRC)/zlib/0002-Add-an-option-to-enable-disable-building-examples.patch
 	# disable the installation of the dynamic library since there's no option
 	sed -e 's,install(TARGETS zlib zlibstatic,install(TARGETS zlibstatic,' -i.orig $(UNPACK_DIR)/CMakeLists.txt
+	# only use the proper libz name for the static library
+	sed -e 's,set_target_properties(zlib zlibstatic ,set_target_properties(zlibstatic ,' -i.orig $(UNPACK_DIR)/CMakeLists.txt
 	$(MOVE)
 
-ZLIB_CONF = -DINSTALL_PKGCONFIG_DIR:STRING=$(PREFIX)/lib/pkgconfig
+ZLIB_CONF = -DINSTALL_PKGCONFIG_DIR:STRING=$(PREFIX)/lib/pkgconfig -DBUILD_EXAMPLES=OFF
 
 # ASM is disabled as the necessary source files are not in the tarball nor the git
 # ifeq ($(ARCH),i386)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/02c95ad3816366ea2a4da4a599ba7e53545ef4e6...1419660b5e4cc260adcdaf8d51ae50b3b7cf700a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/02c95ad3816366ea2a4da4a599ba7e53545ef4e6...1419660b5e4cc260adcdaf8d51ae50b3b7cf700a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list