1
0
Fork 0

meson: apply custom manifest on windows

Co-authored-by: arch1t3cht <arch1t3cht@gmail.com>
This commit is contained in:
sepro 2022-08-19 10:28:38 +02:00 committed by arch1t3cht
parent 22fb4c6e8c
commit 1469f1499b
3 changed files with 25 additions and 18 deletions

View File

@ -337,8 +337,15 @@ subdir('tests')
aegisub_cpp_pch = ['src/include/agi_pre.h']
aegisub_c_pch = ['src/include/agi_pre_c.h']
link_args = []
if host_machine.system() == 'windows'
manifest_file = configure_file(copy: true, input: 'src/res/aegisub.exe.manifest', output: 'aegisub.exe.manifest')
link_args += ['/MANIFEST:EMBED', '/MANIFESTINPUT:@0@'.format(manifest_file)]
endif
aegisub = executable('aegisub', aegisub_src, version_h, acconf,
link_with: [libresrc, libluabins, libaegisub],
link_args: link_args,
include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc, include_directories('src')],
cpp_pch: aegisub_cpp_pch,
c_pch: aegisub_c_pch,
@ -346,13 +353,3 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf,
install_dir: bindir,
dependencies: deps,
win_subsystem: 'windows')
if host_machine.system() == 'windows'
mt_exe = find_program('mt.exe')
apply_manifest = find_program(meson.project_source_root() / 'tools/apply-manifest.py')
custom_target('apply-manifest',
input: aegisub,
output: 'applied_manifest',
command: [apply_manifest, mt_exe, '@INPUT@'],
build_by_default: true)
endif

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<description>Aegisub Subtitle Editor</description>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
</assembly>

View File

@ -1,8 +0,0 @@
#!/usr/bin/env python3
import sys, subprocess, pathlib, os
mt_exe, executable = sys.argv[1:]
subprocess.run([mt_exe, '-manifest', executable + '.manifest', '-outputresource:' + executable + ';1'])
pathlib.Path(os.path.join(os.path.dirname(executable), 'applied_manifest')).touch()