From 8e284d026e8b234d2eb9b2ffa5ab3348dbe656be Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 29 Feb 2024 08:44:49 +0100 Subject: Rust: Move 'libformat_parser' build into libgrust Addresses #2883. contrib/ * gcc_update (files_and_dependencies): Update for 'libformat_parser' in libgrust. gcc/rust/ * Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser' build in libgrust. (%.toml:, $(LIBFORMAT_PARSER):): Remove. libgrust/ * libformat_parser/Makefile.am: New. * Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'. * configure.ac: Handle it. (TARGET_LIBRARY): New 'AM_CONDITIONAL'. * libformat_parser/Makefile.in: Generate. * Makefile.in: Regenerate. * configure: Likewise. --- gcc/rust/Make-lang.in | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index b3301f5..baf5516 100644 --- a/gcc/rust/Make-lang.in +++ b/gcc/rust/Make-lang.in @@ -212,8 +212,7 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS) rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a -LIBFORMAT_PARSER_D = rust/libformat_parser -LIBFORMAT_PARSER = $(LIBFORMAT_PARSER_D)/debug/liblibformat_parser.a +LIBFORMAT_PARSER = ../libgrust/libformat_parser/debug/liblibformat_parser.a RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) @@ -412,19 +411,6 @@ rust/%.o: rust/lex/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< $(POSTCOMPILE) -%.toml: - echo $@ - -# TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable? -$(LIBFORMAT_PARSER): $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs) - cargo \ - --config $(srcdir)/../libgrust/libformat_parser/.cargo/config \ - build \ - --offline \ - --target-dir $(LIBFORMAT_PARSER_D) \ - --manifest-path $(srcdir)/../libgrust/libformat_parser/Cargo.toml \ - # FIXME: Not always '--release', right? - # build all rust/parse files in rust folder, add cross-folder includes rust/%.o: rust/parse/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< -- cgit v1.1