[vlc-commits] [Git][videolan/vlc][master] meson: add Windows Resource files to the .exe/.dll compilation

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 17 08:44:52 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5c792531 by Steve Lhomme at 2026-09-17T08:24:04+00:00
meson: add Windows Resource files to the .exe/.dll compilation

- - - - -


5 changed files:

- bin/meson.build
- lib/meson.build
- meson.build
- modules/meson.build
- src/meson.build


Changes:

=====================================
bin/meson.build
=====================================
@@ -22,8 +22,27 @@ if build_vlc and (host_system != 'darwin' or have_osx) and not have_win_store an
         endif
     endif
 
+    vlc_win_extra = []
+    if host_system == 'windows'
+        vlc_rc = configure_file(
+            input: 'vlc_win32_rc.rc.in',
+            output: 'vlc_win32_rc.rc',
+            configuration: rc_conf,
+            install: false,
+        )
+        vlc_win_extra = windows_rc.compile_resources(
+            vlc_rc,
+            include_directories: [
+                vlc_src_root / 'share/icons',
+                vlc_src_root / 'extras/package/win32',
+            ],
+            implicit_include_directories: true,
+            depend_files: files('../extras/package/win32/vlc.exe.manifest'),
+        )
+    endif
+
     executable('vlc',
-        vlc_sources,
+        vlc_sources + vlc_win_extra,
         link_with: [libvlc, libvlccore],
         include_directories: [vlc_include_dirs],
         dependencies: vlc_deps,
@@ -46,7 +65,7 @@ if build_vlc and (host_system != 'darwin' or have_osx) and not have_win_store an
     )
 
     vlc_cache_gen_dep = executable('vlc-cache-gen',
-        ['cachegen.c'],
+        ['cachegen.c'] + vlc_win_extra,
         link_with: [vlc_libcompat, libvlc],
         include_directories: [vlc_include_dirs],
         install: true,
@@ -72,7 +91,7 @@ if build_vlc and (host_system != 'darwin' or have_osx) and not have_win_store an
     ]
 
     executable('vlc-preparser',
-        vlc_preparser_sources,
+        vlc_preparser_sources + vlc_win_extra,
         link_with: [libvlc, libvlccore, vlc_libcompat],
         include_directories: [vlc_include_dirs],
         dependencies: vlc_deps,
@@ -82,7 +101,7 @@ if build_vlc and (host_system != 'darwin' or have_osx) and not have_win_store an
     )
 
     vlc_preparser_static_dep = executable('vlc-preparser-static',
-        vlc_preparser_sources,
+        vlc_preparser_sources + vlc_win_extra,
         link_with: [libvlc, libvlccore, vlc_libcompat],
         include_directories: [vlc_include_dirs],
         dependencies: vlc_deps,


=====================================
lib/meson.build
=====================================
@@ -23,6 +23,26 @@ if host_system in ['windows', 'os/2']
     libvlc_cargs += ['-DLIBVLC_DLL_EXPORT']
 endif
 
+
+if host_system == 'windows'
+    libvlc_rc = configure_file(
+        input: 'libvlc_win32_rc.rc.in',
+        output: 'libvlc_win32_rc.rc',
+        configuration: rc_conf,
+        install: false,
+    )
+    libvlc_sources += windows_rc.compile_resources(
+        libvlc_rc,
+        include_directories: [
+            vlc_src_root / 'share',
+            vlc_src_root / 'extras/package/win32',
+        ],
+        implicit_include_directories: true,
+        depend_files: files('../extras/package/win32/libvlc.dll.manifest'),
+    )
+endif
+
+
 libvlc = library('vlc',
     libvlc_sources, rev_target,
     include_directories: [vlc_include_dirs],


=====================================
meson.build
=====================================
@@ -1074,6 +1074,14 @@ vlc_about = custom_target('vlc_about.h',
                                    '@INPUT2@',
                                    '@OUTPUT@'])
 
+if host_system == 'windows'
+    windows_rc = import('windows')
+    # not quoted values
+    rc_conf = cdata
+    rc_conf.set('VERSION', vlc_version)
+    rc_conf.set('COPYRIGHT_YEARS', vlc_copyright_years)
+endif
+
 # Enable stream outputs
 if get_option('stream_outputs')
     cdata.set('ENABLE_SOUT', 1)


=====================================
modules/meson.build
=====================================
@@ -396,6 +396,24 @@ if get_option('qt').allowed() and qt6_dep.found()
     )
 endif
 
+win_extra_sources = []
+if host_system == 'windows'
+    module_rc = configure_file(
+        input: 'module.rc.in',
+        output: 'module.rc',
+        configuration: rc_conf,
+        install: false,
+    )
+    win_extra_sources += windows_rc.compile_resources(
+        module_rc,
+        include_directories: [
+            vlc_src_root / 'share',
+            vlc_src_root / 'extras/package/win32',
+        ],
+        implicit_include_directories: true,
+    )
+endif
+
 #
 # Common module handling code
 #
@@ -468,7 +486,7 @@ foreach module : vlc_modules
 
     vlc_plugin = library(
         module['name'] + '_plugin',
-        module['sources'],
+        module['sources'] + win_extra_sources,
         link_with: [module.get('link_with', []), vlc_libcompat],
         link_args: module.get('link_args', []),
         link_depends: module.get('link_depends', []),


=====================================
src/meson.build
=====================================
@@ -480,6 +480,25 @@ if get_option('update-check').allowed()
     libvlccore_deps += gcrypt_dep
 endif
 
+if host_system == 'windows'
+    libvlccore_rc = configure_file(
+        input: 'libvlccore_win32_rc.rc.in',
+        output: 'libvlccore_win32_rc.rc',
+        configuration: rc_conf,
+        install: false,
+    )
+    libvlccore_sources += windows_rc.compile_resources(
+        libvlccore_rc,
+        include_directories: [
+            vlc_src_root / 'share',
+            vlc_src_root / 'extras/package/win32',
+        ],
+        implicit_include_directories: true,
+        depend_files: files('../extras/package/win32/libvlccore.dll.manifest'),
+    )
+endif
+
+
 libvlccore = library(
     'vlccore',
     libvlccore_sources, vlc_about, fourcc, rev_target,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5c792531164471d5552f84bc42f7f8454c600bc7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5c792531164471d5552f84bc42f7f8454c600bc7
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