Fix bpf, evm Meson builds

This commit is contained in:
Richard Patel 2022-06-09 18:54:35 +02:00 committed by pancake
parent 88f5284422
commit dd7c076bae
1 changed files with 10 additions and 3 deletions

View File

@ -1,8 +1,6 @@
# handle capstone dependency # handle capstone dependency
capstone_dep = dependency('capstone', version: '>=3.0.4', required: false) capstone_dep = dependency('capstone', version: '>=3.0.4', required: false)
if not capstone_dep.found() or not get_option('use_sys_capstone') if not capstone_dep.found() or not get_option('use_sys_capstone')
message('Use bundled capstone')
if get_option('capstone_in_builddir') if get_option('capstone_in_builddir')
capstone_path = join_paths(meson.current_build_dir(), 'capstone') capstone_path = join_paths(meson.current_build_dir(), 'capstone')
else else
@ -10,6 +8,7 @@ if not capstone_dep.found() or not get_option('use_sys_capstone')
endif endif
capstone_version = get_option('use_capstone_version') capstone_version = get_option('use_capstone_version')
message('Use bundled capstone: ' + capstone_version)
res = run_command(py3_exe, '-c', '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(capstone_path)) res = run_command(py3_exe, '-c', '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(capstone_path))
if res.returncode() == 0 if res.returncode() == 0
@ -128,6 +127,14 @@ if not capstone_dep.found() or not get_option('use_sys_capstone')
'arch/TMS320C64x/TMS320C64xModule.c', 'arch/TMS320C64x/TMS320C64xModule.c',
] ]
rel_cs5_files = [ rel_cs5_files = [
'arch/BPF/BPFDisassembler.c',
'arch/BPF/BPFInstPrinter.c',
'arch/BPF/BPFMapping.c',
'arch/BPF/BPFModule.c',
'arch/EVM/EVMDisassembler.c',
'arch/EVM/EVMInstPrinter.c',
'arch/EVM/EVMMapping.c',
'arch/EVM/EVMModule.c',
'arch/X86/X86InstPrinterCommon.c', 'arch/X86/X86InstPrinterCommon.c',
# Add riscv files # Add riscv files
'arch/RISCV/RISCVMapping.c', 'arch/RISCV/RISCVMapping.c',
@ -190,7 +197,7 @@ if not capstone_dep.found() or not get_option('use_sys_capstone')
foreach rel_cs_file : rel_cs5_files foreach rel_cs_file : rel_cs5_files
cs_files += [join_paths(capstone_path, rel_cs_file)] cs_files += [join_paths(capstone_path, rel_cs_file)]
endforeach endforeach
cs_c_args += [ '-DCAPSTONE_HAS_RISCV' ] cs_c_args += [ '-DCAPSTONE_HAS_BPF', '-DCAPSTONE_HAS_EVM', '-DCAPSTONE_HAS_RISCV' ]
endif endif
capstone_includes = [platform_inc, include_directories(join_paths('capstone','include'))] capstone_includes = [platform_inc, include_directories(join_paths('capstone','include'))]