src/ffi: add a check before compiling FFI methods to see if supported