bindings: rust: skip building all rust crates by default
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 May 2023 06:13:44 +0000 (11:43 +0530)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 4 May 2023 12:51:03 +0000 (14:51 +0200)
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@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/rust/Makefile.am
bindings/rust/libgpiod/Makefile.am

index 1e01024b04ead2e65a15697357e4b066d901e6f3..7903f828d87d31a2acc4a56dac7cb9e2957c0864 100644 (file)
@@ -2,22 +2,5 @@
 # SPDX-FileCopyrightText: 2022 Linaro Ltd.
 # SPDX-FileCopyrightTest: 2022 Viresh Kumar <viresh.kumar@linaro.org>
 
-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
index 6b55d0d509d12fdabd35bcc0b05c76e86decc33f..38f2ebf37aff4dc11814cc0f5b9207134718b384 100644 (file)
@@ -2,5 +2,21 @@
 # SPDX-FileCopyrightText: 2022 Linaro Ltd.
 # SPDX-FileCopyrightTest: 2022 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
 
+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