Il lun 14 set 2020, 18:23 Richard Henderson ha scritto: > Do we really need to keep testing $source/.git and $git_update? > Surely we can accumulate git_submodules and then do (or not do) something > with > that at the end without all of the tests? > Possibly, but I don't mind going through that separately. > and in meson.build: > > > > capstone = not_found > > build_internal_capstone = false > > if get_option('capstone') != 'no' > > if get_option('capstone') != 'internal' > > capstone = dependency('capstone', > > required: get_option('capstone') == 'system', > > method: 'pkg-config', > > static: enable_static) > > endif > > build_internal_capstone = not capstone.found() > > endif > > ... > > if build_internal_capstone > > ... > > capstone = declare_dependency(...) > > endif > > This doesn't seem like it would do the right thing for capstone=auto, > --disable-git-update, and no system library. In that case auto should > resolve to no. > Indeed, that would require some filesystem check like fs = import('fs') build_internal_capstone = not capstone.found() and \ (get_option('capstone') == 'internal' or \ fs.exists('capstone/Makefile')) I don't think we can move this detection to meson until the definition of > CONFIG_CAPSTONE is under control of meson. > Yep, that's another part that needs to be moved to meson.build in this patch with config_host_data.set. But this patch is the right one to do this. Paolo > > +option('capstone', type: 'combo', value: 'auto', > > + choices: ['auto', 'system', 'internal', 'no'], > > + description: 'How to find the capstone library') > > I can certainly change this. I presume this validates that the > -Dcapstone=foo > value passed to meson is correct? > > > r~ > >