shlr/meson: use source path to store capstone directory (#10993)

* shlr/meson: use an option to chose whether to use builddir or not
This commit is contained in:
Riccardo Schirone 2018-08-10 10:31:17 +02:00 committed by GitHub
parent 54176f1bbc
commit 4b2e1359ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -69,7 +69,6 @@ shlr/sdb/src/sdb_version.h
shlr/sdb/src/libsdb.so*
shlr/spp/config.h
sys/travis/*.txt
shlr/capstone/
sys/.mark_python-deps
sys/.mark_swig
sys/_work

View File

@ -12,6 +12,7 @@ option('r2_hud', type: 'string', value: '')
option('r2_version_commit', type: 'string', value: '')
option('r2_gittap', type: 'string', value: '')
option('r2_gittip', type: 'string', value: '')
option('capstone_in_builddir', type: 'boolean', value: false, description: 'When true, capstone is downloaded in the build directory and not in the source one')
option('use_sys_capstone', type: 'boolean', value: false)
option('use_sys_magic', type: 'boolean', value: false)
option('use_sys_zip', type: 'boolean', value: false)

View File

@ -3,7 +3,12 @@ capstone_dep = dependency('capstone', version: '>=3.0.4', required: false)
if not capstone_dep.found() or not get_option('use_sys_capstone')
message('Use bundled capstone')
capstone_path = join_paths(meson.current_build_dir(), 'capstone')
if get_option('capstone_in_builddir')
capstone_path = join_paths(meson.current_build_dir(), 'capstone')
else
capstone_path = join_paths(meson.current_source_dir(), 'capstone')
endif
res = run_command(py3_exe, '-c', '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(capstone_path))
if res.returncode() == 0
if not git_exe.found()