Skip to content

Commit

Permalink
Added improvements, found in review
Browse files Browse the repository at this point in the history
  • Loading branch information
amibranch committed Oct 23, 2024
1 parent d447870 commit d7db846
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 32 deletions.
12 changes: 4 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ endif

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
lang_opt = ['c_std=gnu99']
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
lang_opt = ['c_std=c99']
else
lang_opt = []
endif

# Sanitize correct usage of rz_strf()
Expand Down Expand Up @@ -179,15 +175,15 @@ cmake_package_relative_path = run_command(py3_exe, cmake_package_prefix_dir_py,
subproject_clean_error_msg = '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`.'

# handle capstone dependency
capstone_dep = dependency('capstone', version: '>=4.0.2', required: get_option('use_sys_capstone'), static: is_static_build, default_options: lang_opt)
capstone_dep = dependency('capstone', version: '>=4.0.2', required: get_option('use_sys_capstone'), static: is_static_build)
if not capstone_dep.found()
capstone_version = get_option('use_capstone_version')
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(subproject_clean_error_msg)
endif
capstone_proj = subproject('capstone-' + capstone_version, default_options: ['default_library=static'] + lang_opt)
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
Expand Down Expand Up @@ -635,13 +631,13 @@ if r.returncode() == 1 and get_option('subprojects_check')
error(subproject_clean_error_msg)
endif

libzip_dep = dependency('libzip', required: get_option('use_sys_libzip'), static: is_static_build, default_options: lang_opt)
libzip_dep = dependency('libzip', required: get_option('use_sys_libzip'), static: is_static_build)
if not libzip_dep.found()
libzip_proj = subproject('libzip', default_options: [
'default_library=static',
'static_runtime=@0@'.format(is_static_build),
'use_sys_openssl=@0@'.format(get_option('use_sys_libzip_openssl')),
] + lang_opt)
])
libzip_dep = libzip_proj.get_variable('libzip_dep')
endif

Expand Down
11 changes: 8 additions & 3 deletions subprojects/packagefiles/capstone-4.0.2/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
project('capstone', 'c',
version: '4.0.2',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

cs_files = [
'arch/AArch64/AArch64BaseInfo.c',
'arch/AArch64/AArch64Disassembler.c',
Expand Down
11 changes: 8 additions & 3 deletions subprojects/packagefiles/capstone-5.0.1/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
project('capstone', 'c',
version: '5.0.1',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

cs_files = [
'arch/AArch64/AArch64BaseInfo.c',
'arch/AArch64/AArch64Disassembler.c',
Expand Down
11 changes: 8 additions & 3 deletions subprojects/packagefiles/capstone-auto-sync-aarch64/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
project('capstone', 'c',
version: '5.0.1',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

cs_files = [
'arch/AArch64/AArch64BaseInfo.c',
'arch/AArch64/AArch64Disassembler.c',
Expand Down
11 changes: 8 additions & 3 deletions subprojects/packagefiles/capstone-next/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
project('capstone', 'c',
version: 'next',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

cs_files = [
'arch/Alpha/AlphaDisassembler.c',
'arch/Alpha/AlphaInstPrinter.c',
Expand Down
9 changes: 6 additions & 3 deletions subprojects/packagefiles/libzip-1.9.2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ project('libzip', 'c',
version: '1.9.2',
license: 'BSD-3-clause',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

py3_exe = import('python').find_installation()
cc = meson.get_compiler('c')
is_static_build = get_option('static_runtime')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

# Create config.h file
conf_data = configuration_data()
zlib_dep = dependency('zlib', required: get_option('use_sys_zlib'), static: is_static_build)
Expand Down
4 changes: 4 additions & 0 deletions subprojects/packagefiles/pcre2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ project('pcre2', 'c', version: '10.44')

cc = meson.get_compiler('c')

if cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

conf_data = configuration_data()

pcre2_chartables = configure_file(input : 'src/pcre2_chartables.c.dist',
Expand Down
9 changes: 6 additions & 3 deletions subprojects/packagefiles/tree-sitter-0.21.0/meson.build
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
project('tree-sitter', 'c',
license: 'MIT',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

tree_sitter_path = 'tree-sitter'

tree_sitter_files = ['lib/src/lib.c']
Expand Down
9 changes: 6 additions & 3 deletions subprojects/packagefiles/xz-5.2.9/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ project('liblzma', 'c',
version : '5.4.3',
license : ['PD', 'LGPL2', 'GPL2', 'GPL3'],
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

lzma_cflags = ['-DHAVE_CONFIG_H', '-DTUKLIB_SYMBOL_PREFIX=lzma_', '-DLZMA_API_STATIC']

cdata = configuration_data()
Expand Down
7 changes: 7 additions & 0 deletions subprojects/rzgdb/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
project('rzw32dbg_wrap', 'c')

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

gdb_files = [
'src/arch.c',
Expand Down
11 changes: 8 additions & 3 deletions subprojects/rzqnx/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
project('rzqnx', 'c',
license: 'GPL-2.0-only',
meson_version: '>=0.55.0',
default_options: [
'c_std=c99',
]
)

cc = meson.get_compiler('c')

if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
endif

qnx_files = [
'src/core.c',
'src/packet.c',
Expand Down

0 comments on commit d7db846

Please sign in to comment.