[vlc-commits] [Git][videolan/vlc][master] 5 commits: meson: remove no longer required array joins

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu May 28 12:16:01 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
58d6d3eb by Marvin Scholz at 2026-05-28T12:03:54+00:00
meson: remove no longer required array joins

These are no longer required since meson 1.0 as it introduced
the ability to pass an array to the prefix kwarg.

- - - - -
20cc6ea2 by Marvin Scholz at 2026-05-28T12:03:54+00:00
meson: use array for prefix in pollfd check

- - - - -
f7420eaa by Marvin Scholz at 2026-05-28T12:03:54+00:00
meson: use array for prefix in sockaddr check

- - - - -
3c2dfbe2 by Marvin Scholz at 2026-05-28T12:03:54+00:00
meson: use array for vlc_conf_prefix

- - - - -
e5f54ad9 by Marvin Scholz at 2026-05-28T12:03:54+00:00
meson: add configure line to config.h

Equivalent of what we do in autotools.

- - - - -


2 changed files:

- meson.build
- modules/text_renderer/meson.build


Changes:

=====================================
meson.build
=====================================
@@ -136,7 +136,7 @@ cargo_bin = find_program('cargo', required: get_option('rust'))
 #
 # General feature defines
 #
-vlc_conf_prefix = ''
+vlc_conf_prefix = []
 
 feature_defines = [
     ['_GNU_SOURCE', 1], # Enable GNU extensions on systems that have them
@@ -144,7 +144,7 @@ feature_defines = [
 
 foreach d : feature_defines
     cdata.set(d.get(0), d.get(1))
-    vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
+    vlc_conf_prefix += '#define @0@ @1@'.format(d.get(0), d.get(1))
 endforeach
 
 vlc_tests = []
@@ -303,10 +303,8 @@ foreach header : check_c_headers
         continue
     endif
 
-    # TODO: Once we require meson 1.0, drop the array join here
-    # See: https://github.com/mesonbuild/meson/pull/11099
     if cc.check_header(header[0],
-                       prefix: '\n'.join(header_kwargs.get('prefix', [])),
+                       prefix: header_kwargs.get('prefix', []),
                        args: header_kwargs.get('args', []))
         cdata.set('HAVE_' + header[0].underscorify().to_upper(), 1)
     endif
@@ -314,10 +312,8 @@ endforeach
 
 foreach header : check_cpp_headers
     header_kwargs = header.get(1, {})
-    # TODO: Once we require meson 1.0, drop the array join here
-    # See: https://github.com/mesonbuild/meson/pull/11099
     if cpp.check_header(header[0],
-                       prefix: '\n'.join(header_kwargs.get('prefix', [])),
+                       prefix: header_kwargs.get('prefix', []),
                        args: header_kwargs.get('args', []))
         cdata.set('HAVE_' + header[0].underscorify().to_upper(), 1)
     endif
@@ -399,7 +395,7 @@ windows_version_test = '''
 
     foreach d : windows_defines
         cdata.set(d.get(0), d.get(1))
-        vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
+        vlc_conf_prefix += '#define @0@ @1@'.format(d.get(0), d.get(1))
     endforeach
 
     mingw_check = '''
@@ -455,7 +451,7 @@ ucrt_version_test = '''
 
         foreach d : mingw_defines
             cdata.set(d.get(0), d.get(1))
-            vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
+            vlc_conf_prefix += '#define @0@ @1@'.format(d.get(0), d.get(1))
         endforeach
 
         # fno-strict-aliasing is necessary for WRL and IID_PPV_ARGS to work safely
@@ -934,7 +930,7 @@ endif
 
 # Check for struct sockaddr_storage type
 # Define it to `sockaddr` if missing
-sockaddr_prefix = '#include <sys/types.h>\n'
+sockaddr_prefix = ['#include <sys/types.h>']
 if host_system == 'windows'
     sockaddr_prefix += '#include <winsock2.h>'
 else
@@ -955,16 +951,14 @@ if not cc.has_type('ssize_t', prefix: '#include <sys/types.h>')
 endif
 
 # Check for struct pollfd type
-# TODO: Refactor once updating to meson 1.0.0
-# which supports prefix arrays.
-pollfd_prefix = '#include <sys/types.h>\n'
+pollfd_prefix = ['#include <sys/types.h>']
 if cdata.get('HAVE_POLL', 0) == 1
     pollfd_prefix += '#include <poll.h>'
 elif host_system == 'windows'
     pollfd_prefix += '#include <winsock2.h>'
 endif
 
-if cc.has_type('struct pollfd', prefix: '\n'.join([vlc_conf_prefix, pollfd_prefix]))
+if cc.has_type('struct pollfd', prefix: vlc_conf_prefix + pollfd_prefix)
     cdata.set('HAVE_STRUCT_POLLFD', 1)
 endif
 
@@ -1029,7 +1023,7 @@ 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',      '[not implemented with meson]') # TODO
+cdata.set_quoted('CONFIGURE_LINE',      meson.build_options())
 
 # Paths
 prefix_path = get_option('prefix')


=====================================
modules/text_renderer/meson.build
=====================================
@@ -83,11 +83,11 @@ vlc_modules += {
 
 # Windows SAPI text to speech
 if host_system == 'windows'
-    have_sapi = cpp.has_type('ISpObjectToken', prefix: '\n'.join([
+    have_sapi = cpp.has_type('ISpObjectToken', prefix: [
         '#include <windows.h>',
         '#include <sapi.h>',
         '#include <sphelper.h>'
-    ]))
+    ])
 else
     have_sapi = false
 endif



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b458b2a2b38e5eeb462459bd860b24fb4d103bee...e5f54ad9618e03c58e852f61903e32b1cc94f930

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b458b2a2b38e5eeb462459bd860b24fb4d103bee...e5f54ad9618e03c58e852f61903e32b1cc94f930
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