The standard approach of declaring an entry for a GEOS function in _geos.pxd does not work when the function is not available in a given older version of GEOS.
In the C extension, we are able to use macros like GEOS_SINCE_3_7_0 to conditionally include these for the compiler.
I don't see a similar mechanism for Cython.
It looks like other projects (e.g,. Fiona) deal with this by defining shim *.pxd files that are dynamically selected and used for the build based on the targeted version of the C library. I'm not yet sure how those handle functions that were introduced into later versions of the C library.
Is there a better alternative approach?
The standard approach of declaring an entry for a GEOS function in
_geos.pxddoes not work when the function is not available in a given older version of GEOS.In the C extension, we are able to use macros like
GEOS_SINCE_3_7_0to conditionally include these for the compiler.I don't see a similar mechanism for Cython.
It looks like other projects (e.g,. Fiona) deal with this by defining shim
*.pxdfiles that are dynamically selected and used for the build based on the targeted version of the C library. I'm not yet sure how those handle functions that were introduced into later versions of the C library.Is there a better alternative approach?