[PATCH] bindings: rust: skip building all rust crates by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <bartosz.golaszewski@xxxxxxxxxx>
Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
---
 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 1e01024b04ea..7903f828d87d 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 <viresh.kumar@xxxxxxxxxx>
 
-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 6b55d0d509d1..38f2ebf37aff 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 <bartosz.golaszewski@xxxxxxxxxx>
 
+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.31.1.272.g89b43f80a514




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux