[vlc-commits] [Git][videolan/vlc][master] 2 commits: core: pass the CONFIGURE_LINE in the command-line on meson

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jun 24 06:48:35 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b15739a0 by Steve Lhomme at 2026-06-24T06:36:16+00:00
core: pass the CONFIGURE_LINE in the command-line on meson

CONFIGURE_LINE is only used in messages.c. We don't need it in config.h otherwise
it changes when a module is enabled/disabled and everything is rebuilt.

Unlike autotools meson+ninja is smart enough to rebuild the parts that changed
even when it's in the command-line parameters. In this case it will still rebuild the whole
core whenever a configuration parameter changes, but it's still better than the whole
project.

Before:

> configured with '-Dc_args=-D__MSVCRT_VERSION__=0xE00 -D_UCRT -DNTDDI_VERSION=0x06010000 -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -fdebug-prefix-map='"'"'/mnt/s/'"'"'='"'"'s:/'"'"' --start-no-unused-arguments -g -gcodeview --end-no-unused-arguments -Dalarm=' '-Dc_link_args=-lucrt --start-no-unused-arguments -Wl,-pdb= --end-no-unused-arguments --start-no-unused-arguments -Wl,-l:libunwind.a -Wl,-l:libpthread.a -static-libstdc++ --end-no-unused-arguments -Wl,-pdb=' '-Dcpp_args=-D__MSVCRT_VERSION__=0xE00 -D_UCRT -DNTDDI_VERSION=0x06010000 -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -fdebug-prefix-map='"'"'/mnt/s/'"'"'='"'"'s:/'"'"' --start-no-unused-arguments -g -gcodeview --end-no-unused-arguments --start-no-unused-arguments -Wl,-l:libunwind.a --end-no-unused-arguments -Dalarm=' '-Dcpp_link_args=-lucrt --start-no-unused-arguments -Wl,-pdb= --end-no-unused-arguments --start-no-unused-arguments -Wl,-l:libunwind.a -Wl,-l:libpthread.a -static-libstdc++ --end-no-unused-arguments -Wl,-pdb=' -Dcmake_prefix_path=/mnt/s/sources/build/win-llvm22/contrib/x86_64-w64-mingw32ucrt -Dlua=enabled -Dflac=enabled -Dtheoradec=enabled -Dtheoraenc=enabled -Davcodec=enabled -Dmerge-ffmpeg=true -Dlibass=enabled -Dshout=enabled -Dgoom2=enabled -Dsse=enabled -Dzvbi=enabled -Dtelx=disabled -Ddvdread=enabled -Dnls=disabled -Dextra_checks=true -Dqt=enabled -Dskins2=enabled -Dupdate-check=enabled -Dcaca=enabled -Dprefix=/ -Dbuildtype=debugoptimized -Dprefer_static=True --cross-file=/mnt/s/sources/build/win-llvm22/win64-ucrt-meson/crossfile.meson --cross-file=/mnt/s/sources/build/win-llvm22/contrib/x86_64-w64-mingw32ucrt/share/meson/cross/contrib.ini

After:

> configured with '-Dc_args=-D__MSVCRT_VERSION__=0xE00 -D_UCRT -DNTDDI_VERSION=0x06010000 -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -fdebug-prefix-map=\'/mnt/s/\'=\'s:/\' --start-no-unused-arguments -g -gcodeview --end-no-unused-arguments -Dalarm=' '-Dc_link_args=-lucrt --start-no-unused-arguments -Wl,-pdb= --end-no-unused-arguments --start-no-unused-arguments -Wl,-l:libunwind.a -Wl,-l:libpthread.a -static-libstdc++ --end-no-unused-arguments -Wl,-pdb=' '-Dcpp_args=-D__MSVCRT_VERSION__=0xE00 -D_UCRT -DNTDDI_VERSION=0x06010000 -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -fdebug-prefix-map=\'/mnt/s/\'=\'s:/\' --start-no-unused-arguments -g -gcodeview --end-no-unused-arguments --start-no-unused-arguments -Wl,-l:libunwind.a --end-no-unused-arguments -Dalarm=' '-Dcpp_link_args=-lucrt --start-no-unused-arguments -Wl,-pdb= --end-no-unused-arguments --start-no-unused-arguments -Wl,-l:libunwind.a -Wl,-l:libpthread.a -static-libstdc++ --end-no-unused-arguments -Wl,-pdb=' -Dcmake_prefix_path=/mnt/s/sources/build/win-llvm22/contrib/x86_64-w64-mingw32ucrt -Dlua=enabled -Dflac=enabled -Dtheoradec=enabled -Dtheoraenc=enabled -Davcodec=enabled -Dmerge-ffmpeg=true -Dlibass=enabled -Dshout=enabled -Dgoom2=enabled -Dsse=enabled -Dzvbi=enabled -Dtelx=disabled -Ddvdread=enabled -Dnls=disabled -Dextra_checks=true -Dqt=enabled -Dskins2=enabled -Dupdate-check=enabled -Dcaca=enabled -Dprefix=/ -Dbuildtype=debugoptimized -Dprefer_static=True --cross-file=/mnt/s/sources/build/win-llvm22/win64-ucrt-meson/crossfile.meson --cross-file=/mnt/s/sources/build/win-llvm22/contrib/x86_64-w64-mingw32ucrt/share/meson/cross/contrib.ini

The main difference is the fdebug-prefix-map which has less quotes, more in line
with what I use in the command line.

- - - - -
ade73b24 by Steve Lhomme at 2026-06-24T06:36:16+00:00
meson: generate a C file with the build configuration

This avoids rebuilding the whole core when a module is enabled/disabled.

- - - - -


5 changed files:

- + buildsystem/gen-build-config.py
- config.h.meson
- meson.build
- src/meson.build
- src/misc/messages.c


Changes:

=====================================
buildsystem/gen-build-config.py
=====================================
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+# SPDX-License-Identifier: ISC
+# Copyright © 2026 VideoLabs, VLC authors and VideoLAN
+#
+# Authors: Steve Lhomme <robux4 at videolabs.io>
+#
+# Generate a C file with the CONFIGURE_LINE defined via the first argument
+
+import argparse
+
+parser = argparse.ArgumentParser()
+parser.add_argument("build_config", type=str)
+args = parser.parse_args()
+
+output_str = '/* Automatically generated file - DO NOT EDIT */\n\n'
+output_str += 'const char CONFIGURE_LINE[] =\n"'
+output_str += args.build_config.replace('/\'','\'').replace('"', '\\"')
+output_str += '";\n\n'
+
+print(output_str)


=====================================
config.h.meson
=====================================
@@ -21,9 +21,6 @@
 /* Define to 1 if SSSE3 inline assembly is available. */
 #mesondefine CAN_COMPILE_SSSE3
 
-/* The ./configure command line */
-#mesondefine CONFIGURE_LINE
-
 /* Copyright string */
 #mesondefine COPYRIGHT_MESSAGE
 


=====================================
meson.build
=====================================
@@ -1031,7 +1031,6 @@ cdata.set_quoted('COPYRIGHT_MESSAGE',   f'Copyright © @vlc_copyright_years@ the
 cdata.set_quoted('VLC_COMPILER',        cc.get_id() + ' ' + cc.version())
 cdata.set_quoted('VLC_COMPILE_BY',      '[not implemented with meson]') # TODO
 cdata.set_quoted('VLC_COMPILE_HOST',    '[not implemented with meson]') # TODO
-cdata.set_quoted('CONFIGURE_LINE',      meson.build_options())
 
 # Paths
 prefix_path = get_option('prefix')


=====================================
src/meson.build
=====================================
@@ -26,6 +26,13 @@ fourcc = custom_target('fourcc_tables.h',
                         command: [fourcc_gen])
 
 
+meson_build_config = custom_target('build_config.c',
+    command: [find_program('../buildsystem/gen-build-config.py'),
+              meson.build_options().replace('\'"\'"\'', '\\\'')],
+    capture: true,
+    output: 'build_config.c',
+)
+
 #
 # libvlccore dependencies
 #
@@ -297,6 +304,8 @@ libvlccore_sources_base = files(
     'misc/tracer.c',
 )
 
+libvlccore_sources_base += meson_build_config
+
 libvlccore_sout_sources = [
     'stream_output/sap.c',
     'stream_output/stream_output.c',


=====================================
src/misc/messages.c
=====================================
@@ -44,6 +44,11 @@
 #include "rcu.h"
 #include "../libvlc.h"
 
+#ifndef CONFIGURE_LINE
+// generated C file
+extern const char CONFIGURE_LINE[];
+#endif
+
 #ifdef _WIN32
 static const char msg_type[4][9] = { "", " error", " warning", " debug" };
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e1d73e29995a2c5239971a186d38338b5bfb54c9...ade73b24aff67962278ea8dabf58be96d93ca0b3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e1d73e29995a2c5239971a186d38338b5bfb54c9...ade73b24aff67962278ea8dabf58be96d93ca0b3
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list