Set the default capstone version to v5 instead of v4

Co-authored-by: wargio <[email protected]>
This commit is contained in:
yossizap
2023-07-16 13:22:47 +08:00
committed by Anton Kochkov
co-authored by wargio
parent f29171ceb1
commit 4aadd18f7e
9 changed files with 27 additions and 36 deletions
+3 -3
View File
@@ -63,7 +63,7 @@ jobs:
linux-clang-tests-asan,
linux-gcc-tests-codecov,
capstone-v3,
capstone-next,
capstone-v4,
]
include:
- name: linux-meson-clang-tests
@@ -149,11 +149,11 @@ jobs:
timeout: 45
cflags: "-Wno-cpp"
allow_failure: false
- name: capstone-next
- name: capstone-v4
os: ubuntu-22.04
build_system: meson
compiler: gcc
meson_options: -Dbuildtype=release -Duse_capstone_version=next --werror
meson_options: -Dbuildtype=release -Duse_capstone_version=v4 --werror
run_tests: false
enabled: ${{ (github.event_name != 'pull_request' || contains(github.head_ref, 'capstone')) && needs.changes.outputs.edited == 'true' }}
timeout: 45
+2 -2
View File
@@ -43,7 +43,7 @@ analysis_plugins_list = [
'xap',
'xcore_cs',
]
if capstone_dep.version().split('.')[0].to_int() > 4
if capstone_dep.version() == 'next' or capstone_dep.version().split('.')[0].to_int() > 4
analysis_plugins_list += 'riscv_cs'
endif
@@ -232,7 +232,7 @@ rz_analysis_sources = [
'../asm/arch/luac/v53/opcode_53.c'
]
if capstone_dep.version().split('.')[0].to_int() > 4
if capstone_dep.version() == 'next' or capstone_dep.version().split('.')[0].to_int() > 4
rz_analysis_sources += 'p/analysis_riscv_cs.c'
endif
+3 -2
View File
@@ -53,7 +53,8 @@ asm_plugins_list = [
'xap',
'xcore_cs',
]
if capstone_dep.version().split('.')[0].to_int() > 4
if capstone_dep.version() == 'next' or capstone_dep.version().split('.')[0].to_int() > 4
asm_plugins_list += 'riscv_cs'
endif
@@ -234,7 +235,7 @@ rz_asm_sources = [
'arch/z80/z80.c',
]
if capstone_dep.version().split('.')[0].to_int() > 4
if capstone_dep.version() == 'next' or capstone_dep.version().split('.')[0].to_int() > 4
rz_asm_sources += 'p/asm_riscv_cs.c'
endif
+3 -21
View File
@@ -176,30 +176,12 @@ cmake_package_relative_path = run_command(py3_exe, cmake_package_prefix_dir_py,
capstone_dep = dependency('capstone', version: '>=3.0.4', required: get_option('use_sys_capstone'), static: is_static_build)
if not capstone_dep.found()
capstone_version = get_option('use_capstone_version')
if capstone_version == 'bundled'
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-bundled', check: false)
if fs.is_file('subprojects/capstone-' + capstone_version + '.wrap')
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-' + capstone_version, check: false)
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
capstone_proj = subproject('capstone-bundled', default_options: ['default_library=static'])
elif capstone_version == 'next'
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-next', check: false)
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
capstone_proj = subproject('capstone-next', default_options: ['default_library=static'])
elif capstone_version == 'v3'
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-v3', check: false)
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
capstone_proj = subproject('capstone-v3', default_options: ['default_library=static'])
elif capstone_version == 'v4'
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-v4', check: false)
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
capstone_proj = subproject('capstone-v4', default_options: ['default_library=static'])
capstone_proj = subproject('capstone-' + capstone_version, default_options: ['default_library=static'])
else
error('Wrong capstone version selected. Please use one of the supported versions.')
endif
+1 -1
View File
@@ -20,7 +20,7 @@ option('rizin_bindings', type: 'string', value: '', description: 'Path where riz
option('checks_level', type: 'integer', value: 9999, description: 'Value between 0 and 3 to enable different level of assert (see RZ_CHECKS_LEVEL). By default its value depends on buildtype (2 on debug, 1 on release).')
option('use_sys_capstone', type: 'feature', value: 'disabled')
option('use_capstone_version', type: 'combo', choices: ['v3', 'v4', 'next', 'bundled'], value: 'bundled', description: 'Specify which version of capstone to use')
option('use_capstone_version', type: 'combo', choices: ['v3', 'v4', 'v5', 'next'], value: 'next', description: 'Specify which version of capstone to use')
option('use_sys_magic', type: 'feature', value: 'disabled')
option('use_sys_libzip', type: 'feature', value: 'disabled')
option('use_sys_libzip_openssl', type: 'boolean', value: false, description: 'Whether to use or not system openssl dependency to build libzip')
-5
View File
@@ -1,5 +0,0 @@
[wrap-git]
url = https://github.com/rizinorg/capstone.git
revision = ed254c8a42b2fd6271cb66578440e5064356f6b5
patch_directory = capstone-bundled
directory = capstone-bundled
+6
View File
@@ -0,0 +1,6 @@
[wrap-file]
source_url = https://github.com/capstone-engine/capstone/releases/download/5.0-post1/capstone-5.0-post1.tar.xz
source_filename = capstone-5.0-post1.tar.xz
source_hash = a27d70a06854289d56cb58ed6de081c540a23faf7c0ef12ff8bdf90b2801f0c5
patch_directory = capstone-5.0-post1
directory = capstone-5.0-post1
@@ -1,4 +1,4 @@
project('capstone', 'c', version: '4.0', meson_version: '>=0.55.0')
project('capstone', 'c', version: '5.0-post1', meson_version: '>=0.55.0')
cs_files = [
'arch/AArch64/AArch64BaseInfo.c',
@@ -43,15 +43,21 @@ cs_files = [
'arch/X86/X86IntelInstPrinter.c',
'arch/X86/X86Mapping.c',
'arch/X86/X86Module.c',
'arch/X86/X86InstPrinterCommon.c',
'arch/XCore/XCoreDisassembler.c',
'arch/XCore/XCoreInstPrinter.c',
'arch/XCore/XCoreMapping.c',
'arch/XCore/XCoreModule.c',
'arch/TriCore/TriCoreDisassembler.c',
'arch/TriCore/TriCoreInstPrinter.c',
'arch/TriCore/TriCoreMapping.c',
'arch/TriCore/TriCoreModule.c',
'cs.c',
'MCInst.c',
'MCInstrDesc.c',
'MCRegisterInfo.c',
'SStream.c',
'Mapping.c',
'utils.c',
]
@@ -73,6 +79,7 @@ libcapstone_c_args = [
'-DCAPSTONE_HAS_X86',
'-DCAPSTONE_HAS_XCORE',
'-DCAPSTONE_HAS_TMS320C64X',
'-DCAPSTONE_HAS_TRICORE',
]
libcapstone = library('capstone', cs_files,
@@ -1,4 +1,4 @@
project('capstone', 'c', version: '5.0', meson_version: '>=0.55.0')
project('capstone', 'c', version: 'next', meson_version: '>=0.55.0')
cs_files = [
'arch/AArch64/AArch64BaseInfo.c',