diff --git a/meson.build b/meson.build index 1448c971a..767a1c6ed 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/src/res/aegisub.exe.manifest b/src/res/aegisub.exe.manifest new file mode 100644 index 000000000..e391b8eba --- /dev/null +++ b/src/res/aegisub.exe.manifest @@ -0,0 +1,18 @@ + + + Aegisub Subtitle Editor + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/apply-manifest.py b/tools/apply-manifest.py deleted file mode 100644 index 3ea84624d..000000000 --- a/tools/apply-manifest.py +++ /dev/null @@ -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()