[vlc-commits] contrib: set BUILD_SHARED_LIBS OFF (static libraries) for all cmake targets

Steve Lhomme git at videolan.org
Tue Jul 7 09:10:28 CEST 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 18 11:10:10 2020 +0200| [de28e3985fcf700e06e68fbbe056e9f69df406ec] | committer: Steve Lhomme

contrib: set BUILD_SHARED_LIBS OFF (static libraries) for all cmake targets

We build all contribs as static libraries.

The setting exists since CMake 3.0. For targets built with older CMake settings
the value is discarded.

(cherry picked from commit 9f5188734f19846ccb68cbcfdd67e732a59bb9ed) (rebased)

rebased:
- mysofa uses pthreadGC2 in this branch

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=de28e3985fcf700e06e68fbbe056e9f69df406ec
---

 contrib/src/chromaprint/rules.mak | 2 +-
 contrib/src/ebml/rules.mak        | 2 +-
 contrib/src/gme/rules.mak         | 2 +-
 contrib/src/main.mak              | 3 ++-
 contrib/src/matroska/rules.mak    | 2 +-
 contrib/src/mysofa/rules.mak      | 2 +-
 contrib/src/openjpeg/rules.mak    | 2 +-
 contrib/src/soxr/rules.mak        | 1 -
 contrib/src/taglib/rules.mak      | 4 +---
 9 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/contrib/src/chromaprint/rules.mak b/contrib/src/chromaprint/rules.mak
index 235b2cdd99..fe50f1a332 100644
--- a/contrib/src/chromaprint/rules.mak
+++ b/contrib/src/chromaprint/rules.mak
@@ -21,6 +21,6 @@ chromaprint: chromaprint-$(CHROMAPRINT_VERSION).tar.gz .sum-chromaprint
 DEPS_chromaprint = ffmpeg $(DEPS_ffmpeg)
 
 .chromaprint: chromaprint .ffmpeg toolchain.cmake
-	cd $< && $(HOSTVARS_PIC) $(CMAKE) -DBUILD_SHARED_LIBS:BOOL=OFF
+	cd $< && $(HOSTVARS_PIC) $(CMAKE)
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index ce1f3a31df..1215552181 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -21,6 +21,6 @@ ebml: libebml-$(EBML_VERSION).tar.xz .sum-ebml
 EBML_CXXFLAGS := $(CXXFLAGS) $(PIC) -fexceptions -fvisibility=hidden
 
 .ebml: ebml toolchain.cmake
-	cd $< && $(HOSTVARS_PIC) CXXFLAGS="$(EBML_CXXFLAGS)" $(CMAKE) -DBUILD_SHARED_LIBS=OFF -DENABLE_WIN32_IO=OFF
+	cd $< && $(HOSTVARS_PIC) CXXFLAGS="$(EBML_CXXFLAGS)" $(CMAKE) -DENABLE_WIN32_IO=OFF
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/gme/rules.mak b/contrib/src/gme/rules.mak
index 5f6e4a0228..60af152940 100644
--- a/contrib/src/gme/rules.mak
+++ b/contrib/src/gme/rules.mak
@@ -18,6 +18,6 @@ game-music-emu: game-music-emu-$(GME_VERSION).tar.bz2 .sum-gme
 	$(MOVE)
 
 .gme: game-music-emu toolchain.cmake
-	cd $< && $(HOSTVARS_PIC) $(CMAKE) -DBUILD_SHARED_LIBS=OFF .
+	cd $< && $(HOSTVARS_PIC) $(CMAKE) .
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index ca5c5f4312..dc4816982c 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -384,7 +384,8 @@ endif
 RECONF = mkdir -p -- $(PREFIX)/share/aclocal && \
 	cd $< && $(AUTORECONF) -fiv $(ACLOCAL_AMFLAGS)
 CMAKE = cmake . -DCMAKE_TOOLCHAIN_FILE=$(abspath toolchain.cmake) \
-		-DCMAKE_INSTALL_PREFIX=$(PREFIX) $(CMAKE_GENERATOR)
+		-DCMAKE_INSTALL_PREFIX=$(PREFIX) $(CMAKE_GENERATOR) \
+		-DBUILD_SHARED_LIBS:BOOL=OFF
 ifdef HAVE_WIN32
 CMAKE += -DCMAKE_DEBUG_POSTFIX:STRING=
 endif
diff --git a/contrib/src/matroska/rules.mak b/contrib/src/matroska/rules.mak
index 7a9ddc61eb..631a13b88f 100644
--- a/contrib/src/matroska/rules.mak
+++ b/contrib/src/matroska/rules.mak
@@ -27,6 +27,6 @@ MATROSKA_CXXFLAGS +=  -O2
 endif
 
 .matroska: libmatroska toolchain.cmake
-	cd $< && $(HOSTVARS_PIC) CXXFLAGS="$(MATROSKA_CXXFLAGS)" $(CMAKE) -DBUILD_SHARED_LIBS=OFF
+	cd $< && $(HOSTVARS_PIC) CXXFLAGS="$(MATROSKA_CXXFLAGS)" $(CMAKE)
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/mysofa/rules.mak b/contrib/src/mysofa/rules.mak
index 432aef502d..a42a9822cc 100644
--- a/contrib/src/mysofa/rules.mak
+++ b/contrib/src/mysofa/rules.mak
@@ -29,7 +29,7 @@ mysofa: libmysofa-$(MYSOFA_VERSION).tar.gz .sum-mysofa
 
 .mysofa: mysofa toolchain.cmake
 	cd $< && rm -f CMakeCache.txt
-	cd $< && $(HOSTVARS) CFLAGS="$(MYSOFA_CFLAGS)" CXXFLAGS="$(MYSOFA_CXXFLAGS)" $(CMAKE) -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
+	cd $< && $(HOSTVARS) CFLAGS="$(MYSOFA_CFLAGS)" CXXFLAGS="$(MYSOFA_CXXFLAGS)" $(CMAKE) -DBUILD_TESTS=OFF
 	cd $< && $(MAKE) install
 	touch $@
 
diff --git a/contrib/src/openjpeg/rules.mak b/contrib/src/openjpeg/rules.mak
index 005bf24bfa..7e66021159 100644
--- a/contrib/src/openjpeg/rules.mak
+++ b/contrib/src/openjpeg/rules.mak
@@ -31,7 +31,7 @@ endif
 
 .openjpeg: openjpeg toolchain.cmake
 	cd $< && $(HOSTVARS) CFLAGS="$(OPENJPEG_CFLAGS)" CXXFLAGS="$(OPENJPEG_CXXFLAGS)" $(CMAKE) \
-		-DBUILD_SHARED_LIBS:bool=OFF -DBUILD_PKGCONFIG_FILES=ON \
+		-DBUILD_PKGCONFIG_FILES=ON \
 			-DBUILD_CODEC:bool=OFF \
 		.
 	cd $< && $(MAKE) install
diff --git a/contrib/src/soxr/rules.mak b/contrib/src/soxr/rules.mak
index 555160f3f0..a35bab6110 100644
--- a/contrib/src/soxr/rules.mak
+++ b/contrib/src/soxr/rules.mak
@@ -32,7 +32,6 @@ endif
 	rm -f $</CMakeCache.txt
 	cd $< && $(HOSTVARS_PIC) $(CMAKE) \
 		$(SOXR_EXTRA_CONF) \
-		-DBUILD_SHARED_LIBS=OFF \
 		-DBUILD_EXAMPLES=OFF \
 		-DBUILD_TESTS=OFF \
 		-DWITH_LSR_BINDINGS=OFF \
diff --git a/contrib/src/taglib/rules.mak b/contrib/src/taglib/rules.mak
index b967b7d54f..1763f05743 100644
--- a/contrib/src/taglib/rules.mak
+++ b/contrib/src/taglib/rules.mak
@@ -22,8 +22,6 @@ taglib: taglib-$(TAGLIB_VERSION).tar.gz .sum-taglib
 	$(MOVE)
 
 .taglib: taglib toolchain.cmake
-	cd $< && $(HOSTVARS_PIC) $(CMAKE) \
-		-DBUILD_SHARED_LIBS:BOOL=OFF \
-		.
+	cd $< && $(HOSTVARS_PIC) $(CMAKE) .
 	cd $< && $(MAKE) install
 	touch $@



More information about the vlc-commits mailing list