[vlc-commits] [Git][videolan/vlc][master] 8 commits: contrib: call meson from the current directory

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 15 09:09:46 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7d6501b2 by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: call meson from the current directory

- - - - -
aa8b38be by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: remove the meson build folders from the top directory

- - - - -
ddbfe0bd by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: call meson install instead of ninja

Just like we have CMAKEBUILD we can use meson to call build and use whatever
it picks for the build system.

- - - - -
0b2008e9 by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: add MESONBUILD similar to CMAKEBUILD

We don't use the '+' in front because it doesn't use the jobserver from our
make call, because of ninja:
https://github.com/ninja-build/ninja/issues/1139

- - - - -
159d8609 by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: move the build and source folders in the MESON command

This simplifies the meson calls without worrying where the files will be put.

- - - - -
d0055d6c by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: use a command to clean the meson contrib before rebuilding

Now the meson build folder is handled in a single place.

- - - - -
dd7c9efe by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: don't rebuild meson projects if nothing changed

Removing only the meson-private data will trigger a reconfiguration of the
project. If the configuration ends up being the same as before only the
modified files will be rebuilt.

This is similar to the configure we redo with autotools targets. We don't
rebuild everything if the configure produced the same configuration. If source
files have changed they will be rebuilt.

- - - - -
0773a89e by Steve Lhomme at 2022-09-15T07:16:41+00:00
contrib: allow adding custom parameters to the meson build phase

like MESON_BUILD="-v -j4"

We need to split the compile and install phases as install doesn't have as many
options as compile.

- - - - -


10 changed files:

- contrib/src/basu/rules.mak
- contrib/src/dav1d/rules.mak
- contrib/src/fribidi/rules.mak
- contrib/src/harfbuzz/rules.mak
- contrib/src/libdsm/rules.mak
- contrib/src/libplacebo/rules.mak
- contrib/src/librist/rules.mak
- contrib/src/main.mak
- contrib/src/medialibrary/rules.mak
- contrib/src/microdns/rules.mak


Changes:

=====================================
contrib/src/basu/rules.mak
=====================================
@@ -24,7 +24,7 @@ basu: basu-$(BASU_VERSION).tar.gz .sum-basu
 	$(MOVE)
 
 .basu: basu crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON)
+	$(MESONBUILD)
 	touch $@


=====================================
contrib/src/dav1d/rules.mak
=====================================
@@ -26,7 +26,7 @@ dav1d: dav1d-$(DAV1D_VERSION).tar.xz .sum-dav1d
 	$(MOVE)
 
 .dav1d: dav1d crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) $(DAV1D_CONF) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) $(DAV1D_CONF)
+	$(MESONBUILD)
 	touch $@


=====================================
contrib/src/fribidi/rules.mak
=====================================
@@ -18,7 +18,7 @@ fribidi: fribidi-$(FRIBIDI_VERSION).tar.xz .sum-fribidi
 
 # FIXME: DEPS_fribidi = iconv $(DEPS_iconv)
 .fribidi: fribidi crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Ddocs=false -Dbin=false -Dtests=false build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) -Ddocs=false -Dbin=false -Dtests=false
+	$(MESONBUILD)
 	touch $@


=====================================
contrib/src/harfbuzz/rules.mak
=====================================
@@ -30,7 +30,7 @@ HARFBUZZ_CONF += -Dcoretext=enabled
 endif
 
 .harfbuzz: harfbuzz crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) $(HARFBUZZ_CONF) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) $(HARFBUZZ_CONF)
+	$(MESONBUILD)
 	touch $@


=====================================
contrib/src/libdsm/rules.mak
=====================================
@@ -27,7 +27,7 @@ DEPS_libdsm += pthreads $(DEPS_pthreads)
 endif
 
 .libdsm: libdsm crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Dauto_features=disabled -Dbinaries=false build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) -Dauto_features=disabled -Dbinaries=false
+	$(MESONBUILD)
 	touch $@


=====================================
contrib/src/libplacebo/rules.mak
=====================================
@@ -45,9 +45,9 @@ endif
 	$(MOVE)
 
 .libplacebo: libplacebo crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) $(PLACEBOCONF) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) $(PLACEBOCONF)
+	$(MESONBUILD)
 # Work-around for full paths to static libraries, which libtool does not like
 # See https://github.com/mesonbuild/meson/issues/5479
 	(cd $(UNPACK_DIR) && $(SRC_BUILT)/pkg-rewrite-absolute.py -i "$(PREFIX)/lib/pkgconfig/libplacebo.pc")


=====================================
contrib/src/librist/rules.mak
=====================================
@@ -33,7 +33,7 @@ librist: librist-$(LIBRIST_VERSION).tar.gz .sum-librist
 	$(MOVE)
 
 .librist: librist crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) $(LIBRIST_CONF) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) $(LIBRIST_CONF)
+	$(MESONBUILD)
 	touch $@


=====================================
contrib/src/main.mak
=====================================
@@ -464,8 +464,8 @@ ifeq ($(V),1)
 CMAKE += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
 endif
 
-MESONFLAGS = --default-library static --prefix "$(PREFIX)" --backend ninja \
-	-Dlibdir=lib
+MESONFLAGS = $</build $< --default-library static --prefix "$(PREFIX)" \
+	--backend ninja -Dlibdir=lib
 ifndef WITH_OPTIMIZATION
 MESONFLAGS += --buildtype debug
 else
@@ -497,6 +497,8 @@ MESON = env -i PATH="$(PREFIX)/bin:$(PATH)" \
 else
 MESON = meson $(MESONFLAGS)
 endif
+MESONCLEAN = rm -rf $</build/meson-private
+MESONBUILD = meson compile -C $</build $(MESON_BUILD) && meson install -C $</build
 
 ifdef GPL
 REQUIRE_GPL =


=====================================
contrib/src/medialibrary/rules.mak
=====================================
@@ -18,8 +18,8 @@ medialibrary: medialibrary-$(MEDIALIBRARY_VERSION).tar.bz2 .sum-medialibrary
 	$(MOVE)
 
 .medialibrary: medialibrary crossfile.meson
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Dlibvlc=disabled -Dlibtool_workaround=true build
-	ninja -C $</build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) -Dlibvlc=disabled -Dlibtool_workaround=true
+	$(MESONBUILD)
 	touch $@
 


=====================================
contrib/src/microdns/rules.mak
=====================================
@@ -22,7 +22,7 @@ microdns: microdns-$(LIBMICRODNS_VERSION).tar.xz .sum-microdns
 	$(MOVE)
 
 .microdns: microdns crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Dauto_features=disabled build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(HOSTVARS_MESON) $(MESON) -Dauto_features=disabled
+	$(MESONBUILD)
 	touch $@



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5c49d608f7748b5981457e741c219c35624e0811...0773a89ed61faf9a933d4c715d2773d71e866598

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5c49d608f7748b5981457e741c219c35624e0811...0773a89ed61faf9a933d4c715d2773d71e866598
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