shithub: dav1d

Download patch

ref: bb8725fb412552f6393fb5eced8fda47cb686acd
parent: c2ade34fb266c5090f1a2022145cb99e9e21f263
author: Hugo Beauzée-Luyssen <[email protected]>
date: Fri Sep 28 12:59:47 EDT 2018

win32: Generate a resource file & link it with the library

Fix #37

--- a/meson.build
+++ b/meson.build
@@ -288,6 +288,23 @@
     bitdepth_objs += bitdepth_lib.extract_all_objects()
 endforeach
 
+if host_machine.system() == 'windows'
+    winmod = import('windows')
+    rc_data = configuration_data()
+    rc_data.set('VERSION_MAJOR', dav1d_version_major)
+    rc_data.set('VERSION_MINOR', dav1d_version_minor)
+    rc_data.set('VERSION_REVISION', dav1d_version_revision)
+    rc_data.set('VERSION_EXTRA', '0')
+    rc_data.set('COPYRIGHT_YEARS', '2018')
+
+    rc_file = configure_file(input: 'src/dav1d.rc.in',
+                output: 'dav1d.rc', configuration: rc_data)
+    rc_source = winmod.compile_resources(rc_file,
+                    include_directories: include_directories('src'))
+    libdav1d_sources += rc_source
+    #entrypoints_objs += rc_source
+endif
+
 libdav1d = library('dav1d',
     libdav1d_sources, nasm_objs,
     version: meson.project_version(),
--- /dev/null
+++ b/src/dav1d.rc.in
@@ -1,0 +1,28 @@
+#define VERSION_NUMBER @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@
+#define VERSION_NUMBER_STR "@VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@"
+
+#include <winuser.h>
+
+1 VERSIONINFO
+FILETYPE 2
+FILEOS 4
+PRODUCTVERSION VERSION_NUMBER
+FILEVERSION VERSION_NUMBER
+BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN
+    BLOCK "040904E4"
+    BEGIN
+      VALUE "CompanyName", "VideoLAN"
+      VALUE "ProductName", "dav1d"
+      VALUE "ProductVersion", VERSION_NUMBER_STR
+      VALUE "FileVersion", VERSION_NUMBER_STR
+      VALUE "FileDescription", "dav1d AV1 decoder"
+      VALUE "LegalCopyright", "Copyright \251 @COPYRIGHT_YEARS@ VideoLAN and dav1d Authors"
+    END
+  END
+  BLOCK "VarFileInfo"
+  BEGIN
+    VALUE "Translation", 0x409, 1252
+  END
+END