Skip to content

Add native Meson build - #45

Merged
gistrec merged 1 commit into
masterfrom
meson/native-build
Jul 8, 2026
Merged

gistrec merged 1 commit into
masterfrom
meson/native-build

Conversation

@gistrec

@gistrec gistrec commented Jul 8, 2026 •

Copy link
Copy Markdown
Owner

Adds a native Meson build alongside the existing CMake/build2 ones, so the library is consumable as a Meson subproject / WrapDB wrap without a downstream-maintained build description.

What's here

  • meson.build — header-only: declare_dependency on include/, meson.override_dependency('geo-utils-cpp', …) so dependency('geo-utils-cpp') resolves in a consumer without pkg-config, and install_subdir('include/geo') for meson install.
  • meson_options.txt — a tests feature (default auto). The self-verifying examples/gps_track.cpp is built standalone (or on -Dtests=enabled) and registered as a smoke test; it is not built when the library is pulled in as a subproject, so consumers don't compile our example into their tree.
  • ci.yml — a meson-build job (meson setup + meson test) so the file can't drift out of sync with the header layout.

Why

The WrapDB PR currently carries the build description in a downstream packagefile that hardcodes our internal layout. Shipping Meson upstream lets the wrap drop that packagefile and carry only the .wrap (URL + hash) — the build description travels with the code and stays a single source of truth.

Verified locally

  • meson test → gps_track smoke test passes (AppleClang 17, arm64).
  • Consumed as a subproject from a throwaway project: dependency('geo-utils-cpp') resolves, #include <geo/geo.hpp> compiles and runs, and the example target is absent from the consumer's build.

version is kept in sync with CMakeLists.txt / include/geo/version.hpp by a comment; the existing test suite already asserts those two agree.

Ship a header-only meson.build (declare_dependency + override_dependency
+ header install) so the project is consumable as a Meson subproject /
WrapDB wrap without a downstream-maintained build description that can
drift out of sync with the headers.

examples/gps_track.cpp asserts its own results, so it doubles as an
end-to-end smoke test; it is built standalone (or on -Dtests=enabled)
and skipped when consumed as a subproject. A meson-build CI job runs it
so the wrap can't rot silently.
@gistrec
gistrec merged commit 87ec960 into master Jul 8, 2026
12 checks passed
@gistrec gistrec mentioned this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant