mirror of
https://github.com/frida/frida
synced 2026-08-13 06:26:05 -04:00
build: Add Meson build system
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
This commit is contained in:
parent
1e9112162d
commit
9b68d34e03
2 changed files with 164 additions and 0 deletions
99
meson.build
Normal file
99
meson.build
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
project('frida', 'c',
|
||||
version: run_command('releng' / 'frida_version.py', check: true).stdout().strip(),
|
||||
)
|
||||
|
||||
fs = import('fs')
|
||||
python = import('python').find_installation()
|
||||
|
||||
is_cross_build = meson.is_cross_build()
|
||||
|
||||
gum_options = [
|
||||
'frida_version=' + meson.project_version(),
|
||||
'graft_tool=' + (get_option('graft_tool').disable_auto_if(is_cross_build).allowed() ? 'enabled' : 'disabled'),
|
||||
'gumjs=enabled',
|
||||
]
|
||||
subproject('frida-gum', default_options: gum_options)
|
||||
|
||||
core_options = [
|
||||
'frida_version=' + meson.project_version(),
|
||||
'portal=' + (get_option('portal').allowed() ? 'enabled' : 'disabled'),
|
||||
]
|
||||
foreach component : ['gadget', 'server', 'inject']
|
||||
core_options += component + '=' + (get_option(component).disable_auto_if(not is_cross_build).allowed() ? 'enabled' : 'disabled')
|
||||
endforeach
|
||||
subproject('frida-core', default_options: core_options)
|
||||
|
||||
grab_submodule = ['git', 'submodule', 'update', '--init', '--depth', '1']
|
||||
|
||||
if get_option('frida_clr') \
|
||||
.disable_auto_if(is_cross_build) \
|
||||
.disable_auto_if(build_machine.system() != 'windows') \
|
||||
.disable_auto_if(get_option('b_vscrt').startswith('mt')) \
|
||||
.allowed()
|
||||
dir = 'subprojects' / 'frida-clr'
|
||||
if not fs.exists(dir / 'meson.build')
|
||||
run_command(grab_submodule, dir, check: true)
|
||||
endif
|
||||
if get_option('frida_clr').auto()
|
||||
detect_result = run_command(python, dir / 'detect-netfx.py', check: false)
|
||||
build_clr_bindings = detect_result.returncode() == 0
|
||||
else
|
||||
build_clr_bindings = true
|
||||
endif
|
||||
if build_clr_bindings
|
||||
subproject('frida-clr')
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_option('frida_node') \
|
||||
.disable_auto_if(is_cross_build) \
|
||||
.allowed()
|
||||
dir = 'subprojects' / 'frida-node'
|
||||
if not fs.exists(dir / 'meson.build')
|
||||
run_command(grab_submodule, dir, check: true)
|
||||
endif
|
||||
subproject('frida-node')
|
||||
endif
|
||||
|
||||
if get_option('frida_python') \
|
||||
.disable_auto_if(is_cross_build) \
|
||||
.allowed()
|
||||
dir = 'subprojects' / 'frida-python'
|
||||
if not fs.exists(dir / 'meson.build')
|
||||
run_command(grab_submodule, dir, check: true)
|
||||
endif
|
||||
subproject('frida-python')
|
||||
endif
|
||||
|
||||
if get_option('frida_swift') \
|
||||
.disable_auto_if(is_cross_build) \
|
||||
.disable_auto_if(build_machine.system() != 'macos') \
|
||||
.allowed()
|
||||
dir = 'subprojects' / 'frida-swift'
|
||||
if not fs.exists(dir / 'meson.build')
|
||||
run_command(grab_submodule, dir, check: true)
|
||||
endif
|
||||
subproject('frida-swift')
|
||||
endif
|
||||
|
||||
qt6_dep = dependency('qt6', modules: ['Core'], required: false)
|
||||
if get_option('frida_qml') \
|
||||
.disable_auto_if(is_cross_build) \
|
||||
.disable_auto_if(not qt6_dep.found()) \
|
||||
.allowed()
|
||||
dir = 'subprojects' / 'frida-qml'
|
||||
if not fs.exists(dir / 'meson.build')
|
||||
run_command(grab_submodule, dir, check: true)
|
||||
endif
|
||||
subproject('frida-qml')
|
||||
endif
|
||||
|
||||
if get_option('frida_tools') \
|
||||
.disable_auto_if(is_cross_build) \
|
||||
.allowed()
|
||||
dir = 'subprojects' / 'frida-tools'
|
||||
if not fs.exists(dir / 'meson.build')
|
||||
run_command(grab_submodule, dir, check: true)
|
||||
endif
|
||||
subproject('frida-tools')
|
||||
endif
|
||||
65
meson.options
Normal file
65
meson.options
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
option('frida_tools',
|
||||
type: 'feature',
|
||||
value: 'auto',
|
||||
description: 'Build CLI tools, like frida, frida-trace, etc.',
|
||||
)
|
||||
|
||||
option('graft_tool',
|
||||
type: 'feature',
|
||||
value: 'auto',
|
||||
description: 'Build gum-graft tool',
|
||||
)
|
||||
|
||||
option('gadget',
|
||||
type: 'feature',
|
||||
value: 'auto',
|
||||
description: 'Build frida-gadget',
|
||||
)
|
||||
|
||||
option('server',
|
||||
type: 'feature',
|
||||
value: 'auto',
|
||||
description: 'Build frida-server',
|
||||
)
|
||||
|
||||
option('portal',
|
||||
type: 'feature',
|
||||
value: 'disabled',
|
||||
description: 'Build frida-portal',
|
||||
)
|
||||
|
||||
option('inject',
|
||||
type: 'feature',
|
||||
value: 'auto',
|
||||
description: 'Build frida-inject',
|
||||
)
|
||||
|
||||
option('frida_clr',
|
||||
type: 'feature',
|
||||
value: 'disabled',
|
||||
description: 'Build .NET bindings',
|
||||
)
|
||||
|
||||
option('frida_node',
|
||||
type: 'feature',
|
||||
value: 'disabled',
|
||||
description: 'Build Node.js bindings',
|
||||
)
|
||||
|
||||
option('frida_python',
|
||||
type: 'feature',
|
||||
value: 'auto',
|
||||
description: 'Build Python bindings',
|
||||
)
|
||||
|
||||
option('frida_swift',
|
||||
type: 'feature',
|
||||
value: 'disabled',
|
||||
description: 'Build Swift bindings',
|
||||
)
|
||||
|
||||
option('frida_qml',
|
||||
type: 'feature',
|
||||
value: 'disabled',
|
||||
description: 'Build QML bindings',
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue