On 26/01/21 01:12, Joelle van Dyne wrote:
Here's how meson does cc.has_function

https://github.com/mesonbuild/meson/blob/master/mesonbuild/compilers/mixins/clike.py#L761

Since the compiler error comes from the header file with

__attribute__((availability(ios,unavailable)))

The meson check will always pass.

cc.compiles should work though. Is there a reason why it's not used
instead of all the compile_prog checks in ./configure ?

Just because the Meson build system is only a few months old.

Alternatively:

# If we have any includes in the prefix supplied by the user, assume # that the user wants us to use the symbol prototype defined in those
        # includes. If not, then try to do the Autoconf-style check with
        # a dummy prototype definition of our own.

so adding a "prefix: '#include <stdlib.h>'" to cc.has_function should work too.

Paolo


Reply via email to