diff --git a/meson.build b/meson.build index 1e0951945df9bcb3b6e883bf1801b79681356577..f38fd4bf60ed8c7b057c6eb05f16fd7c0b9cc9a2 100644 --- a/meson.build +++ b/meson.build @@ -127,7 +127,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 @@ -135,7 +135,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 = [] @@ -284,10 +284,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 @@ -295,10 +293,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 @@ -369,7 +365,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 = ''' @@ -426,7 +422,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 @@ -896,7 +892,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 @@ -917,16 +913,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 @@ -991,7 +985,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') diff --git a/modules/text_renderer/meson.build b/modules/text_renderer/meson.build index 52af3f38b1a1a5cd0f1e4085f59e9bb616c3514d..1a8bcf8ebfdd18dcbcfc808d7e49c950370be72c 100644 --- a/modules/text_renderer/meson.build +++ b/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 @@ -98,4 +98,3 @@ vlc_modules += { 'cpp_args' : libcom_cppflags, 'enabled' : have_sapi, } -