From 7bb69cbd292fba8ba808b66750b3c51c1686a718 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 4 May 2023 11:43:44 +0530 Subject: [PATCH] bindings: rust: skip building all rust crates by default We don't really need to build all the available rust crates here by default, but only what's required by the libgpiod crate. Currently we try to build gpiosim-sys crate as well, even if "--enable-tests" isn't passed to autogen.sh, which results in following build failure: error: could not find native static library `gpiosim`, perhaps an -L flag is missing? Fix this by building just the libgpiod crate instead, which can force building of the other crates based on the enabled configuration options. Reported-by: Bartosz Golaszewski Signed-off-by: Viresh Kumar Signed-off-by: Bartosz Golaszewski --- bindings/rust/Makefile.am | 17 ----------------- bindings/rust/libgpiod/Makefile.am | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/bindings/rust/Makefile.am b/bindings/rust/Makefile.am index 1e01024..7903f82 100644 --- a/bindings/rust/Makefile.am +++ b/bindings/rust/Makefile.am @@ -2,22 +2,5 @@ # SPDX-FileCopyrightText: 2022 Linaro Ltd. # SPDX-FileCopyrightTest: 2022 Viresh Kumar -command = cargo build --release --lib - -if WITH_TESTS -command += --tests -endif - -if WITH_EXAMPLES -command += --examples -endif - -all: - $(command) - -clean: - cargo clean - EXTRA_DIST = Cargo.toml - SUBDIRS = gpiosim-sys libgpiod libgpiod-sys diff --git a/bindings/rust/libgpiod/Makefile.am b/bindings/rust/libgpiod/Makefile.am index 6b55d0d..38f2ebf 100644 --- a/bindings/rust/libgpiod/Makefile.am +++ b/bindings/rust/libgpiod/Makefile.am @@ -2,5 +2,21 @@ # SPDX-FileCopyrightText: 2022 Linaro Ltd. # SPDX-FileCopyrightTest: 2022 Bartosz Golaszewski +command = cargo build --release --lib + +if WITH_TESTS +command += --tests +endif + +if WITH_EXAMPLES +command += --examples +endif + +all: + $(command) + +clean: + cargo clean + EXTRA_DIST = Cargo.toml SUBDIRS = examples src tests -- 2.30.2