rpm-ostree/Makefile.bindings
Colin Walters 08c414f897 Rework bindgen/cxx.rs usage and CI build
cxx.rs (aka cxxbridge) and cbindgen are
both generating source code.  Since the last release
we've introduced the former, and we need to ensure
that the generated cxx.rs source ends up in release tarballs
the same way as the cbindgen code.

Rationalize and clean up the binding infrastructure.
Drop support for the vendored cbindgen which we
weren't actually using:
Closes: https://github.com/coreos/rpm-ostree/issues/2392

Move the cxx-rs and cbindgen bits into the same place,
and update our CoreOS CI build to use a separate `Makefile.bindings`
that just generates the code, so our CI still "works like"
a main Koji RPM build.
2021-01-04 13:17:35 +01:00

14 lines
504 B
Makefile

# A plain Makefile (not automake) so that we can run this logic
# without running the autotools.
rpmostree-rust.h:
$(AM_V_GEN) cbindgen -c cbindgen.toml -o $@ $(top_srcdir)
BUILT_SOURCES += rpmostree-rust.h
rpmostree-cxxrs.h: rust/src/lib.rs
$(AM_V_GEN) cxxbridge rust/src/lib.rs --header > $@
rpmostree-cxxrs.cxx: rust/src/lib.rs
$(AM_V_GEN) cxxbridge --include rpmostree-cxxrs.h rust/src/lib.rs > $@
# Invoked in CI
bindings: rpmostree-rust.h rpmostree-cxxrs.h rpmostree-cxxrs.cxx
.PHONY: bindings