summaryrefslogtreecommitdiffstats
path: root/windows/zxing-cpp.mk
blob: 9c52db68323ca6ade092f54f3344369c3b573e22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This file is part of MXE. See LICENSE.md for licensing information.

PKG             := zxing-cpp
$(PKG)_WEBSITE  := https://github.com/zxing-cpp/zxing-cpp
$(PKG)_DESCR    := ZXing-C++, a barcode and QR code reading and writing library
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 2.3.0
$(PKG)_CHECKSUM := 64e4139103fdbc57752698ee15b5f0b0f7af9a0331ecbdc492047e0772c417ba
$(PKG)_GH_CONF  := zxing-cpp/zxing-cpp/tags,v
$(PKG)_DEPS     := cc

# ZXING_WRITERS=OLD builds the MultiFormatWriter encoder, which needs nothing
# else. The new CreateBarcodeFromText() one would pull in libzint, either the
# copy bundled with the sources or one fetched from GitHub at build time.
#
# The examples are off because they fetch stb from GitHub at build time, and the
# tests, the C API and the Python module because nothing here uses them.
#
# 2.3 prefers C++20 but builds as C++17 too; asking for 17 keeps MXE's
# compiler from having to handle C++20 library features it may only partly
# support.
define $(PKG)_BUILD
    cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \
        -DCMAKE_CXX_STANDARD=17 \
        -DZXING_READERS=ON \
        -DZXING_WRITERS=OLD \
        -DZXING_EXAMPLES=OFF \
        -DZXING_BLACKBOX_TESTS=OFF \
        -DZXING_UNIT_TESTS=OFF \
        -DZXING_C_API=OFF \
        -DZXING_PYTHON_MODULE=OFF \
        -DZXING_DEPENDENCIES=LOCAL
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install

    # compile test
    '$(TARGET)-g++' \
        -W -Wall -Werror -std=c++17 \
        '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
        `'$(TARGET)-pkg-config' zxing --cflags --libs`
endef