Unfortunately, this doesn't work for iOS, which defines system() but throws a compile time error if you try to call it.
-j On Fri, Jan 22, 2021 at 3:17 PM Peter Maydell <peter.mayd...@linaro.org> wrote: > > On Fri, 22 Jan 2021 at 23:12, Peter Maydell <peter.mayd...@linaro.org> wrote: > > > > On Fri, 22 Jan 2021 at 20:13, Joelle van Dyne <j...@getutm.app> wrote: > > > > > > Build without error on hosts without a working system(). An assertion > > > will trigger if system() is called. > > > > > > Signed-off-by: Joelle van Dyne <j...@getutm.app> > > > > configure | 19 +++++++++++++++++++ > > > > Can we do the "does system() exist?" check in meson.build ? > > Untested, but looking at the existing check for "does gettid() exist?" > > it should be two lines: > > > > has_system = cc.has_function('system') > > > > and then later: > > > > config_host_data.set('HAVE_SYSTEM_FUNCTION', has_system) > > ...looking at how we do the HAVE_FOO_H settings, I think we > can just collapse this into one line: > > config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system')) > > thanks > -- PMM