From: Viresh Kumar Date: Thu, 4 May 2023 06:13:44 +0000 (+0530) Subject: bindings: rust: skip building all rust crates by default X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7bb69cbd292fba8ba808b66750b3c51c1686a718;p=qemu-gpiodev%2Flibgpiod.git 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 --- 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