aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-02-28 23:26:39 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-08-01 13:11:03 +0200
commitacf10f83abbf57846583ac6feef3f62982f0da5d (patch)
tree8b336ea9a5cecf6746919b553347fec066544e78
parent96a5c5bd28e069116321d471b685c16f7d1df636 (diff)
downloadgcc-acf10f83abbf57846583ac6feef3f62982f0da5d.zip
gcc-acf10f83abbf57846583ac6feef3f62982f0da5d.tar.gz
gcc-acf10f83abbf57846583ac6feef3f62982f0da5d.tar.bz2
Rust: Move 'libformat_parser' build into the GCC build directory
Fixes #2883. gcc/rust/ChangeLog: * Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build directory. * ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
-rw-r--r--gcc/rust/Make-lang.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 497a3c7..b3301f5 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -212,7 +212,8 @@ 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 = $(srcdir)/../libgrust/libformat_parser/target/debug/liblibformat_parser.a
+LIBFORMAT_PARSER_D = rust/libformat_parser
+LIBFORMAT_PARSER = $(LIBFORMAT_PARSER_D)/debug/liblibformat_parser.a
RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
@@ -416,7 +417,13 @@ rust/%.o: rust/lex/%.cc
# 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)
- cd $(srcdir)/../libgrust/libformat_parser && cargo build --offline # FIXME: Not always release, right?
+ 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