Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<FAMILY>=1`` compile flag. Mirror that build here so declarations guarded
# by ``#if <FAMILY>`` 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=[
Expand All @@ -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_*``)
Expand Down
Loading