diff --git a/parser/parser.py b/parser/parser.py index 30f657f..b16dfc2 100644 --- a/parser/parser.py +++ b/parser/parser.py @@ -97,6 +97,18 @@ def merge_meta(idl: dict, meta_path: Path) -> dict: return idl +# The optional families MobilityDB's ``ALL=ON`` build enables, each defining a +# ``-D=1`` compile flag. Mirror that build here so declarations guarded +# by ``#if `` in the core headers (e.g. ``#if POINTCLOUD`` around +# ``meos_initialize_pointcloud`` in meos.h) enter the catalog — the family +# headers themselves are unguarded, but a handful of core-header declarations +# are gated. Kept in sync with MobilityDB CMakeLists.txt's ``if(ALL) foreach``. +_ALL_FAMILIES = ( + "ARROW", "CBUFFER", "H3", "JSON", "NPOINT", "POINTCLOUD", "POSE", + "QUADBIN", "RASTER", "RGEO", +) + + def parse_meos(entry: Path, include_dir: Path) -> dict: index = clang.cindex.Index.create() tu = index.parse(str(entry), args=[ @@ -110,6 +122,7 @@ def parse_meos(entry: Path, include_dir: Path) -> dict: # it, and an undefined ``UNUSED`` makes clang error on the declarator and # silently drop the remaining parameters of that prototype. "-DUNUSED=__attribute__((unused))", + *(f"-D{family}=1" for family in _ALL_FAMILIES), ] + _clang_extra_args(), # Record ``#define`` macro definitions as cursors so the public # object-like integer macros (WKB / WKT variant flags, ``MEOS_FLAG_*``)