]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: borrowck: Build Polonius automatically
authorJakub Dupak <dev@jakubdupak.com>
Tue, 27 Feb 2024 23:08:01 +0000 (00:08 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:22 +0000 (16:35 +0100)
This is minimalistic version to build Polonius with Cargo.

gcc/rust/ChangeLog:

* Make-lang.in: Build Polonius.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
gcc/rust/Make-lang.in

index 33176df6d7ace9f94ec6a0ed0d1c3441b0891d1c..795e899f51ce469f8c3c5efd2e0fff153a15c823 100644 (file)
@@ -264,6 +264,7 @@ rust.srcman:
 # Clean hooks.
 
 rust.mostlyclean:
+       rm -rf rust/ffi-polonius/release libffi_polonius.a
 #      cd $(srcdir)/rust; rm -f *.o y.tab.h y.tab.c lex.yy.c
 
 rust.clean: rust.mostlyclean
@@ -487,3 +488,9 @@ rust/%.o: rust/checks/errors/borrowck/%.cc
 rust/%.o: rust/metadata/%.cc
        $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $<
        $(POSTCOMPILE)
+
+rust/libffi_polonius.a: \
+       rust/checks/errors/borrowck/ffi-polonius/Cargo.toml \
+       $(wildcard $(srcdir)/rust/checks/errors/borrowck/ffi-polonius/src/*)
+       cargo build --manifest-path $(srcdir)/rust/checks/errors/borrowck/ffi-polonius/Cargo.toml --release --target-dir rust/ffi-polonius
+       cp rust/ffi-polonius/release/libffi_polonius.a rust/libffi_polonius.a
\ No newline at end of file