Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Avisynth compilation and update headers #161

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('Aegisub', ['c', 'cpp'],
license: 'BSD-3-Clause',
meson_version: '>=0.56.1',
meson_version: '>=0.57.0',
default_options: ['cpp_std=c++14', 'buildtype=debugoptimized'],
version: '3.2.2')

Expand Down
26 changes: 18 additions & 8 deletions src/libresrc/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
fs = import('fs')

respack = find_program(meson.project_source_root() / 'tools/respack.py')

resrc = [
Expand All @@ -12,17 +14,25 @@ conf_platform_json = configure_file(input: 'default_config_platform.json.in',
configuration: conf_platform)

if host_machine.system() == 'darwin'
resrc += custom_target('default_config.{cpp,h}',
command: [respack, '@INPUT0@', '@OUTPUT@'],
input: [files('manifest_osx.respack'), conf_platform_json],
output: ['default_config.cpp', 'default_config.h'])
resmanifest = 'manifest_osx.respack'
else
resrc += custom_target('default_config.{cpp,h}',
command: [respack, '@INPUT0@', '@OUTPUT@'],
input: [files('manifest.respack'), conf_platform_json],
output: ['default_config.cpp', 'default_config.h'])
resmanifest = 'manifest.respack'
endif

resmanifest_files = [conf_platform_json]
# Filter out the files we've generated ourselves
foreach rfile : fs.read(resmanifest).strip().split('\n')
rfile_s = rfile.strip()
if fs.is_file(rfile_s)
resmanifest_files += files(rfile_s)
endif
endforeach

resrc += custom_target('default_config.{cpp,h}',
command: [respack, '@INPUT0@', '@OUTPUT@'],
input: [files(resmanifest), resmanifest_files],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use the depend_files kwarg for this:

files (str, file, or the return value of configure_file() that this target depends on but are not listed in the command keyword argument. Useful for adding regen dependencies.

output: ['default_config.cpp', 'default_config.h'])


libresrc_inc = include_directories('.')
libresrc = static_library('resrc', 'libresrc.cpp', resrc, include_directories: deps_inc, dependencies: deps)