Merge pull request #2753 from cgwalters/fix-cxx-rebuilds

build-sys: Avoid re-building + re-linking cxx-rs C++ bits each build
This commit is contained in:
Jonathan Lebon 2021-04-16 14:08:09 -04:00 committed by GitHub
commit 464c368c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,13 @@ rpmostree-cxxrs.h: $(binding_rust_sources)
echo cxxbridge failed; exit 1; \
fi
rpmostree-cxxrs.cxx: $(binding_rust_sources) rpmostree-cxxrs.h
$(AM_V_GEN) cxxbridge --include rpmostree-cxxrs.h rust/src/lib.rs > $@
$(AM_V_GEN) if cxxbridge --include rpmostree-cxxrs.h rust/src/lib.rs > $@.tmp; then \
if test -f $@ && cmp $@.tmp $@ 2>/dev/null; then rm -f $@.tmp; else \
mv $@.tmp $@; \
fi; \
else \
echo cxxbridge failed; exit 1; \
fi
# Invoked in CI
bindings: rpmostree-cxxrs.h rpmostree-cxxrs.cxx rust/cxx.h