Skip to content

Commit

Permalink
meson: Fix export of DbgHelp, SymSrv, and vapidir
Browse files Browse the repository at this point in the history
- Install DbgHelp and SymSrv, and move them in the repo to match their
  installed paths. In this way consumers can use the particular prefix
  variable and be able to refer to them whether they're installed or
  uninstalled.
- For vapidir we also need to expose two different values for
  uninstalled vs installed.
  • Loading branch information
oleavr committed May 20, 2024
1 parent 8d9f457 commit b9563ac
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion ext/dbghelp/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dbghelp_prefix = get_option('prefix') / get_option('libdir') / 'frida'
uninstalled_dbghelp_prefix = meson.current_source_dir()

if host_os_family == 'windows' and host_arch in ['x86', 'x86_64']
dbghelp_dll = files('dbghelp-@[email protected]'.format((host_arch == 'x86_64') ? '64' : '32'))
dbghelp_dll = files(host_cpu_mode / 'dbghelp.dll')
install_data(dbghelp_dll, install_dir: dbghelp_prefix / host_cpu_mode)
endif
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion ext/symsrv/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
symsrv_prefix = get_option('prefix') / get_option('libdir') / 'frida'
uninstalled_symsrv_prefix = meson.current_source_dir()

if host_os_family == 'windows' and host_arch in ['x86', 'x86_64']
symsrv_dll = files('symsrv-@[email protected]'.format((host_arch == 'x86_64') ? '64' : '32'))
symsrv_dll = files(host_cpu_mode / 'symsrv.dll')
install_data(symsrv_dll, install_dir: symsrv_prefix / host_cpu_mode)
endif
22 changes: 15 additions & 7 deletions gum/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,25 @@ if gir.found()
)
endif

vapidir = meson.project_source_root() / 'vapi'

uninstalled_variables = {
'frida_vapidir': uninstalled_vapidir,
'frida_dbghelp_prefix': uninstalled_dbghelp_prefix,
'frida_symsrv_prefix': uninstalled_symsrv_prefix,
}

installed_variables = {
'frida_vapidir': vapidir,
'frida_dbghelp_prefix': dbghelp_prefix,
'frida_symsrv_prefix': symsrv_prefix,
}

gum_dep = declare_dependency(link_with: gum,
include_directories: gum_incdirs,
compile_args: extra_cflags,
link_args: extra_libs_private,
dependencies: gum_public_deps,
variables: {
'frida_vapidir': vapidir,
},
variables: uninstalled_variables,
)

pkg = import('pkgconfig')
Expand All @@ -384,9 +393,8 @@ pkg.generate(gum,
subdirs: install_header_basedir,
extra_cflags: extra_cflags,
libraries_private: extra_libs_private,
variables: {
'frida_vapidir': vapidir,
},
variables: installed_variables,
uninstalled_variables: uninstalled_variables,
)

meson.override_dependency('frida-gum-' + api_version, gum_dep)
Expand Down
9 changes: 9 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ else
have_ptrauth = false
endif

if cc.sizeof('void *') == 8
host_cpu_mode = '64'
else
host_cpu_mode = '32'
endif

if host_os_family == 'windows'
host_executable_format = 'pe'
elif host_os_family == 'darwin'
Expand Down Expand Up @@ -741,6 +747,9 @@ endif
install_header_basedir = 'frida-' + api_version
install_header_subdir = install_header_basedir + '/gum'

vapidir = get_option('prefix') / 'share' / 'vala' / 'vapi'
uninstalled_vapidir = meson.current_source_dir() / 'vapi'

subdir('ext')
subdir('gum')
if not diet
Expand Down
2 changes: 1 addition & 1 deletion vapi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ if have_gumjs
]
endif

install_data(vapis, install_dir: 'share' / 'vala' / 'vapi')
install_data(vapis, install_dir: vapidir)

0 comments on commit b9563ac

Please sign in to comment.