All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/zxing-cpp: add options for enabling readers and/or writers
@ 2024-05-15 16:49 Dario Binacchi
  2024-05-17  7:08 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Dario Binacchi @ 2024-05-15 16:49 UTC (permalink / raw)
  To: buildroot; +Cc: michael, linux-amarula, Dario Binacchi

The patch allows you to choose whether to build encoding (BUILD_WRITERS),
decoding (BUILD_READERS) or both. This way, it's possible to keep the
library size at minimum. By default, to ensure backward compatibility,
both are compiled.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/zxing-cpp/Config.in    | 27 +++++++++++++++++++++++++++
 package/zxing-cpp/zxing-cpp.mk | 14 ++++++++++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/package/zxing-cpp/Config.in b/package/zxing-cpp/Config.in
index b72a00ec35f9..f5883045fb1a 100644
--- a/package/zxing-cpp/Config.in
+++ b/package/zxing-cpp/Config.in
@@ -17,3 +17,30 @@ config BR2_PACKAGE_ZXING_CPP
 	  compiles the C++ port.
 
 	  https://github.com/zxing-cpp/zxing-cpp
+
+if BR2_PACKAGE_ZXING_CPP
+
+choice
+	prompt "readers/writers support"
+	default BR2_PACKAGE_ZXING_CPP_READERS_AND_WRITERS
+	help
+	  Select what you want to enable and then compile
+
+config BR2_PACKAGE_ZXING_CPP_READERS
+	bool "readers only"
+	help
+	  Build with only readers (decoders) support
+
+config BR2_PACKAGE_ZXING_CPP_WRITERS
+	bool "writers only"
+	help
+	  Build with only writers (encoders) support
+
+config BR2_PACKAGE_ZXING_CPP_READERS_AND_WRITERS
+	bool "readers and writers"
+	help
+	  Build with readers and writers support
+
+endchoice
+
+endif # BR2_PACKAGE_ZXING_CPP
diff --git a/package/zxing-cpp/zxing-cpp.mk b/package/zxing-cpp/zxing-cpp.mk
index 86a1ef96806d..c37769ea5d6b 100644
--- a/package/zxing-cpp/zxing-cpp.mk
+++ b/package/zxing-cpp/zxing-cpp.mk
@@ -12,8 +12,6 @@ ZXING_CPP_INSTALL_STAGING = YES
 ZXING_CPP_SUPPORTS_IN_SOURCE_BUILD = NO
 ZXING_CPP_DEPENDENCIES = host-pkgconf stb
 ZXING_CPP_CONF_OPTS = \
-	-DBUILD_READERS=ON \
-	-DBUILD_WRITERS=ON \
 	-DBUILD_BLACKBOX_TESTS=OFF \
 	-DBUILD_UNIT_TESTS=OFF \
 	-DBUILD_DEPENDENCIES=LOCAL
@@ -28,4 +26,16 @@ else
 ZXING_CPP_CONF_OPTS += -DBUILD_PYTHON_MODULE=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_ZXING_CPP_READERS)$(BR2_PACKAGE_ZXING_CPP_READERS_AND_WRITERS),y)
+ZXING_CPP_CONF_OPTS += -DBUILD_READERS=ON
+else
+ZXING_CPP_CONF_OPTS += -DBUILD_READERS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_ZXING_CPP_WRITERS)$(BR2_PACKAGE_ZXING_CPP_READERS_AND_WRITERS),y)
+ZXING_CPP_CONF_OPTS += -DBUILD_WRITERS=ON
+else
+ZXING_CPP_CONF_OPTS += -DBUILD_WRITERS=OFF
+endif
+
 $(eval $(cmake-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/zxing-cpp: add options for enabling readers and/or writers
  2024-05-15 16:49 [Buildroot] [PATCH 1/1] package/zxing-cpp: add options for enabling readers and/or writers Dario Binacchi
@ 2024-05-17  7:08 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-17  7:08 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: michael, linux-amarula, buildroot

Hello,

On Wed, 15 May 2024 18:49:12 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:

> +if BR2_PACKAGE_ZXING_CPP
> +
> +choice
> +	prompt "readers/writers support"
> +	default BR2_PACKAGE_ZXING_CPP_READERS_AND_WRITERS
> +	help
> +	  Select what you want to enable and then compile
> +
> +config BR2_PACKAGE_ZXING_CPP_READERS
> +	bool "readers only"
> +	help
> +	  Build with only readers (decoders) support
> +
> +config BR2_PACKAGE_ZXING_CPP_WRITERS
> +	bool "writers only"
> +	help
> +	  Build with only writers (encoders) support
> +
> +config BR2_PACKAGE_ZXING_CPP_READERS_AND_WRITERS
> +	bool "readers and writers"
> +	help
> +	  Build with readers and writers support
> +
> +endchoice

I don't think this should be a choice. Instead, it should be like this:

if BR2_PACKAGE_ZXING_CPP

config BR2_PACKAGE_ZXING_CPP_READERS
	bool "readers support"
	default y
	help
	  Build with readers (decoders) support

config BR2_PACKAGE_ZXING_CPP_WRITERS
	bool "writers support"
	default y
	help
	  Build with writers (encoders) support

endif

Could you rework your patch accordingly?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-17  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15 16:49 [Buildroot] [PATCH 1/1] package/zxing-cpp: add options for enabling readers and/or writers Dario Binacchi
2024-05-17  7:08 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.