From 47078cc11862c564ece3242fa7c8d23fcb914a8b Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Sun, 19 May 2024 09:25:02 +0200 Subject: [PATCH] package/zxing-cpp: add options for enabling readers and/or writers The patch allows you to choose whether to build encoding (BUILD_WRITERS), decoding (BUILD_READERS) or both. At least one of the two options must be enabled. This way, it's possible to keep the library size at minimum. By default, to ensure backward compatibility, both are compiled. Co-Developed-by: Thomas Petazzoni Co-Developed-by: Francesco Nicoletta Puzzillo Signed-off-by: Dario Binacchi Signed-off-by: Yann E. MORIN --- package/zxing-cpp/Config.in | 17 +++++++++++++++++ package/zxing-cpp/zxing-cpp.mk | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/package/zxing-cpp/Config.in b/package/zxing-cpp/Config.in index b72a00ec35..e5b8cfcdd8 100644 --- a/package/zxing-cpp/Config.in +++ b/package/zxing-cpp/Config.in @@ -10,6 +10,7 @@ config BR2_PACKAGE_ZXING_CPP depends on BR2_TOOLCHAIN_HAS_THREADS select BR2_PACKAGE_STB select BR2_PACKAGE_PYTHON_PYBIND if BR2_PACKAGE_PYTHON3 + select BR2_PACKAGE_ZXING_CPP_READERS if !BR2_PACKAGE_ZXING_CPP_WRITERS help ZXing-cpp (pronounced "zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library @@ -17,3 +18,19 @@ config BR2_PACKAGE_ZXING_CPP compiles the C++ port. https://github.com/zxing-cpp/zxing-cpp + +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 # BR2_PACKAGE_ZXING_CPP diff --git a/package/zxing-cpp/zxing-cpp.mk b/package/zxing-cpp/zxing-cpp.mk index 86a1ef9680..077d7e75d3 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),y) +ZXING_CPP_CONF_OPTS += -DBUILD_READERS=ON +else +ZXING_CPP_CONF_OPTS += -DBUILD_READERS=OFF +endif + +ifeq ($(BR2_PACKAGE_ZXING_CPP_WRITERS),y) +ZXING_CPP_CONF_OPTS += -DBUILD_WRITERS=ON +else +ZXING_CPP_CONF_OPTS += -DBUILD_WRITERS=OFF +endif + $(eval $(cmake-package))