meson: fix resource file compilation

This enables video to load correctly in Windows builds
This commit is contained in:
Ryan 2020-12-22 22:52:28 -05:00 committed by Ryan Lucia
parent 106c753782
commit 8cf4100c87
3 changed files with 32 additions and 19 deletions

View file

@ -188,6 +188,33 @@ elif host_machine.system() == 'windows'
else
error('Missing Windows SDK Uniscribe Library (usp10.h / usp10.lib)')
endif
res_inc = include_directories('bitmaps/windows')
res_dep_files = files(
'bitmaps/windows/icon.ico',
'bitmaps/windows/eyedropper.cur',
)
windows = import('windows')
if wx_dep.type_name() != 'not-found' # system wx
raw_wx_windres_args = wx_dep.get_variable(configtool: 'rescomp').split()
wx_windres_args = []
foreach arg: raw_wx_windres_args
if arg != 'windres'
wx_windres_args += arg
endif
endforeach
aegisub_src += windows.compile_resources('res/res.rc',
args: wx_windres_args,
depend_files: res_dep_files,
depends: version_h,
include_directories: [res_inc, version_inc])
else # subproject
wx_inc = wx.include_directories('wxmono')
aegisub_src += windows.compile_resources('res/res.rc',
depend_files: res_dep_files,
depends: version_h,
include_directories: [res_inc, version_inc, wx_inc])
endif
elif conf.get('WITH_FONTCONFIG') == '1'
aegisub_src += 'font_file_lister_fontconfig.cpp'
endif

View file

@ -23,23 +23,9 @@ eyedropper_cursor CURSOR "../bitmaps/windows/eyedropper.cur"
#define wxUSE_NO_MANIFEST 1
#include "wx/msw/wx.rc"
#include "../../build/git_version.h"
#include "git_version.h"
#include <Winver.h>
#ifdef _DEBUG
#ifdef _WIN64
#define AGI_RC_FILENAME "aegisub64d"
#else
#define AGI_RC_FILENAME "aegisub32d"
#endif
#else
#ifdef _WIN64
#define AGI_RC_FILENAME "aegisub64"
#else
#define AGI_RC_FILENAME "aegisub32"
#endif
#endif
#ifdef _DEBUG
#define AGI_RC_FLAG_DEBUG VS_FF_DEBUG
#else
@ -68,8 +54,8 @@ BEGIN
VALUE "CompanyName", "Aegisub"
VALUE "FileDescription", "Aegisub subtitle editor"
VALUE "FileVersion", BUILD_GIT_VERSION_STRING
VALUE "InternalName", AGI_RC_FILENAME
VALUE "OriginalFilename", AGI_RC_FILENAME ".exe"
VALUE "InternalName", "aegisub"
VALUE "OriginalFilename", "aegisub.exe"
VALUE "ProductName", "Aegisub"
VALUE "ProductVersion", BUILD_GIT_VERSION_STRING
END

View file

@ -62,7 +62,7 @@ if ($exactGitTag -match $semVerMatch) {
$tag = git -C $repositoryRootPath describe --exact-match --tags $rev 2>$null
if ($tag -match $semVerMatch) {#
$version['TAGGED_RELEASE'] = $false
$version['RESOURCE_BASE_VERSION'] = $Matches[1..3] + $gitRevision
$version['RESOURCE_BASE_VERSION'] = $Matches[1..3]
$version['INSTALLER_VERSION'] = ($Matches[1..3] -join '.')
break;
}
@ -85,5 +85,5 @@ $version.GetEnumerator() | %{
{"`"$($value.ToString())`""}
}
}
"#define $($_.Key) $($fmtValue)"
"`n#define $($_.Key) $($fmtValue)"
} | Out-File -FilePath $gitVersionHeaderPath -Encoding utf8