Skip to content

Commit

Permalink
meson: Simplify some bits by using newer syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Mar 14, 2024
1 parent 2e8a1bd commit 489eed9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
36 changes: 17 additions & 19 deletions src/api/meson.build
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
generate_api = [python, files('generate.py')]

core_vapi = join_paths(core_build_dir, 'frida-core.vapi')
core_header = join_paths(core_build_dir, 'frida-core.h')
base_vapi = join_paths(base_build_dir, f'frida-base-@api_version@.vapi')
base_header = join_paths(base_build_dir, 'frida-base.h')
generate_api_args = [
api_version,
core_build_dir / 'frida-core.vapi',
core_build_dir / 'frida-core.h',
base_build_dir / f'frida-base-@api_version@.vapi',
base_build_dir / 'frida-base.h',
meson.current_build_dir(),
]

core_public_h = custom_target('frida-core-header',
input: [core, base],
output: ['frida-core.h'],
command: [
generate_api,
'--output=header',
api_version,
core_vapi, core_header,
base_vapi, base_header,
meson.current_build_dir(),
generate_api_args,
],
install: true,
install_dir: header_install_dir,
Expand All @@ -23,24 +24,21 @@ core_public_h = custom_target('frida-core-header',
core_public_vapi = custom_target('frida-core-vapi',
input: [core, base],
output: [
'frida-core-@0@.vapi'.format(api_version),
'frida-core-@0@.deps'.format(api_version)
f'frida-core-@api_version@.vapi',
f'frida-core-@api_version@.deps',
],
command: [
generate_api,
'--output=vapi',
api_version,
core_vapi, core_header,
base_vapi, base_header,
meson.current_build_dir(),
generate_api_args,
],
install: true,
install_dir: join_paths(get_option('datadir'), 'vala', 'vapi'),
install_dir: get_option('datadir') / 'vala' / 'vapi',
)

core_public_lib = custom_target('frida-core-library',
input: [core] + internal_libs,
output: 'libfrida-core-@0@.a'.format(api_version),
output: f'libfrida-core-@api_version@.a',
command: [
python,
files('merge.py'),
Expand Down Expand Up @@ -81,13 +79,13 @@ endif

pkg = import('pkgconfig')
pkg.generate(
filebase: 'frida-core-' + api_version,
filebase: f'frida-core-@api_version@',
name: 'Frida Core',
version: meson.project_version(),
description: 'Frida core library intended for static linking into bindings',
requires: ['glib-2.0', 'gobject-2.0', 'gio-2.0', 'json-glib-1.0'],
requires_private: ['gmodule-2.0', 'gee-0.8', 'libsoup-3.0', 'frida-gum-1.0', 'frida-gumjs-inspector-1.0', 'libbrotlidec'] + backend_reqs_private,
subdirs: 'frida-' + api_version,
subdirs: f'frida-@api_version@',
libraries: [core_public_lib],
libraries_private: backend_libs_private,
extra_cflags: ['-I${frida_includedir}'],
Expand All @@ -101,4 +99,4 @@ pkg.generate(
},
)

meson.override_dependency('frida-core-' + api_version, core_public_dep)
meson.override_dependency(f'frida-core-@api_version@', core_public_dep)
8 changes: 4 additions & 4 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if have_local_backend
command: [
resource_compiler_cmd_array,
'-c', '@INPUT0@',
'-o', join_paths(meson.current_build_dir(), 'frida-data-darwin'),
'-o', meson.current_build_dir() / 'frida-data-darwin',
'@INPUT1@',
'@INPUT2@',
'@INPUT3@',
Expand Down Expand Up @@ -268,7 +268,7 @@ if have_local_backend
command: [
resource_compiler_cmd_array,
'-c', '@INPUT0@',
'-o', join_paths(meson.current_build_dir(), 'frida-data-android'),
'-o', meson.current_build_dir() / 'frida-data-android',
'@INPUT1@',
],
)
Expand Down Expand Up @@ -308,7 +308,7 @@ if have_local_backend
command: [
resource_compiler_cmd_array,
'-c', '@INPUT0@',
'-o', join_paths(meson.current_build_dir(), 'frida-data-helper-backend'),
'-o', meson.current_build_dir() / 'frida-data-helper-backend',
'@INPUT1@',
'@INPUT2@',
],
Expand Down Expand Up @@ -342,7 +342,7 @@ if have_local_backend
'linux' / 'frida-helper-service.vala',
]
helper_symscript = 'linux' / 'frida-helper.version'
helper_link_args = ['-Wl,--version-script,' + join_paths(meson.current_source_dir(), helper_symscript)]
helper_link_args = ['-Wl,--version-script,' + meson.current_source_dir() / helper_symscript]
helper_link_depends = [helper_symscript]
raw_helper = executable('frida-helper-raw', helper_sources,
vala_args: helper_backend_vala_args,
Expand Down

0 comments on commit 489eed9

Please sign in to comment.