Skip to content

Commit dddd4f1

Browse files
committed
Create initial structure
1 parent 3a81f66 commit dddd4f1

13 files changed

Lines changed: 97 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ IF (WITH_PYTHON_MODULE)
3434
add_subdirectory(source/python)
3535
ENDIF()
3636

37+
IF (WITH_WASM_MODULE)
38+
add_subdirectory(source/wasm)
39+
ENDIF()
40+
3741
add_subdirectory(source/test)

conanfile.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class TicketDecoderConan(ConanFile):
1010
name = 'ticket-decoder'
11-
version = 'v0.20'
11+
version = 'v0.21'
1212
settings = "os", "compiler", "build_type", "arch"
1313
generators = "CMakeDeps"
1414
options = {
@@ -18,6 +18,7 @@ class TicketDecoderConan(ConanFile):
1818
"with_ticket_analyzer": [True, False],
1919
"with_ticket_decoder": [True, False],
2020
"with_python_module": [True, False],
21+
"with_wasm_module": [True, False],
2122
"with_square_detector": [True, False],
2223
"with_classifier_detector": [True, False],
2324
"with_barcode_decoder": [True, False],
@@ -35,6 +36,7 @@ class TicketDecoderConan(ConanFile):
3536
"with_ticket_analyzer": True,
3637
"with_ticket_decoder": True,
3738
"with_python_module": True,
39+
"with_wasm_module": True,
3840
"with_square_detector": True,
3941
"with_classifier_detector": True,
4042
"with_barcode_decoder": True,
@@ -94,10 +96,13 @@ def requirements(self):
9496
self.requires("libpng/1.6.58", override=True)
9597

9698
def build_requirements(self):
97-
# https://conan.io/center/recipes/cmake
98-
self.tool_requires("cmake/[>=3.22]")
99+
if not self.options.with_wasm_module: # this fails when using emsdk and seems not required there
100+
# https://conan.io/center/recipes/cmake
101+
self.tool_requires("cmake/[>=3.22]")
102+
99103
#https://conan.io/center/recipes/ninja
100104
self.tool_requires("ninja/[>=1.13]")
105+
101106
# https://conan.io/center/recipes/gtest
102107
self.test_requires("gtest/1.17.0")
103108

@@ -113,6 +118,9 @@ def generate(self):
113118
if self.options.with_python_module:
114119
TicketDecoderConan.add_config_switch(toolchain, "WITH_PYTHON_MODULE")
115120

121+
if self.options.with_wasm_module:
122+
TicketDecoderConan.add_config_switch(toolchain, "WITH_WASM_MODULE")
123+
116124
if self.options.with_square_detector:
117125
TicketDecoderConan.add_config_switch(toolchain, "WITH_SQUARE_DETECTOR")
118126

@@ -144,6 +152,7 @@ def configure(self):
144152
self.output.highlight("with_ticket_analyzer: " + str(self.options.with_ticket_analyzer))
145153
self.output.highlight("with_ticket_decoder: " + str(self.options.with_ticket_decoder))
146154
self.output.highlight("with_python_module: " + str(self.options.with_python_module))
155+
self.output.highlight("with_wasm_module: " + str(self.options.with_wasm_module))
147156
self.output.highlight("with_square_detector: " + str(self.options.with_square_detector))
148157
self.output.highlight("with_classifier_detector: " + str(self.options.with_classifier_detector))
149158
self.output.highlight("with_barcode_decoder: " + str(self.options.with_barcode_decoder))

etc/conan/profiles/emscripten

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[settings]
2+
os=Emscripten
3+
arch=wasm64
4+
compiler=clang
5+
compiler.version=16
6+
compiler.libcxx=libc++
7+
compiler.cppstd=20
8+
9+
[tool_requires]
10+
emsdk/3.1.73

etc/poppler/conanfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class PopplerCppConan(ConanFile):
3030
"with_ticket_analyzer": None,
3131
"with_ticket_decoder": None,
3232
"with_python_module": None,
33+
"with_wasm_module": None,
3334
"with_square_detector": None,
3435
"with_classifier_detector": None,
3536
"with_barcode_decoder": None,
@@ -73,6 +74,7 @@ def configure(self):
7374
self.options.rm_safe("with_ticket_analyzer")
7475
self.options.rm_safe("with_ticket_decoder")
7576
self.options.rm_safe("with_python_module")
77+
self.options.rm_safe("with_wasm_module")
7678
self.options.rm_safe("with_square_detector")
7779
self.options.rm_safe("with_classifier_detector")
7880
self.options.rm_safe("with_barcode_decoder")

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[project]
55
name = "ticket-decoder"
6-
version = "v0.20.1"
6+
version = "v0.21.0"
77
description = "Train ticket barcode to json decoding library, using zxing-cpp decoding in combination with record interpreter, to transform content into json structure"
88
license = "GPL-3.0-or-later"
99
authors = [ { name = "user4223" } ]
@@ -66,6 +66,7 @@ options-all = [
6666
"&:with_ticket_analyzer=False",
6767
"&:with_ticket_decoder=False",
6868
"&:with_python_module=True",
69+
"&:with_wasm_module=False",
6970
"&:with_square_detector=False",
7071
"&:with_classifier_detector=False",
7172
"&:with_barcode_decoder=True",

setup.All.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ${WORKSPACE_ROOT}/etc/conan-install.sh ${BUILD_TYPE} \
1212
-o:a="&:with_ticket_analyzer=True" \
1313
-o:a="&:with_ticket_decoder=True" \
1414
-o:a="&:with_python_module=True" \
15+
-o:a="&:with_wasm_module=False" \
1516
-o:a="&:with_square_detector=True" \
1617
-o:a="&:with_classifier_detector=True" \
1718
-o:a="&:with_barcode_decoder=True" \

setup.Decoder.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ${WORKSPACE_ROOT}/etc/conan-install.sh ${BUILD_TYPE} \
1212
-o:a="&:with_ticket_analyzer=False" \
1313
-o:a="&:with_ticket_decoder=True" \
1414
-o:a="&:with_python_module=False" \
15+
-o:a="&:with_wasm_module=False" \
1516
-o:a="&:with_square_detector=False" \
1617
-o:a="&:with_classifier_detector=False" \
1718
-o:a="&:with_barcode_decoder=True" \

setup.WASM.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: (C) 2022 user4223 and (other) contributors to ticket-decoder <https://github.com/user4223/ticket-decoder>
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
set -o errexit
6+
7+
readonly WORKSPACE_ROOT="$(readlink -f $(dirname "$0"))"
8+
readonly BUILD_TYPE=${1:-Release}
9+
10+
${WORKSPACE_ROOT}/etc/conan-config.sh
11+
${WORKSPACE_ROOT}/etc/conan-install.sh ${BUILD_TYPE} \
12+
-o:a="&:with_ticket_analyzer=False" \
13+
-o:a="&:with_ticket_decoder=False" \
14+
-o:a="&:with_python_module=False" \
15+
-o:a="&:with_wasm_module=True" \
16+
-o:a="&:with_square_detector=False" \
17+
-o:a="&:with_classifier_detector=False" \
18+
-o:a="&:with_barcode_decoder=True" \
19+
-o:a="&:with_pdf_input=True" \
20+
-o:a="&:with_signature_verifier=True" \
21+
-o:a="&:with_uic_interpreter=True" \
22+
-o:a="&:with_vdv_interpreter=True" \
23+
-o:a="&:with_sbb_interpreter=True" \
24+
-pr:h="./etc/conan/profiles/emscripten" \
25+
--build="emsdk/*"
26+
27+
${WORKSPACE_ROOT}/etc/cmake-config.sh ${BUILD_TYPE}
28+
${WORKSPACE_ROOT}/build.sh ${BUILD_TYPE} ${@:2}

source/app/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: (C) 2022 user4223 and (other) contributors to ticket-decoder <https://github.com/user4223/ticket-decoder>
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4-
project(ticket-decoder)
4+
project(ticket-decoder-app)
55

66
find_package(tclap REQUIRED)
77

source/app/source/analyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
int main(int argc, char **argv)
2525
{
26-
auto cmd = TCLAP::CmdLine("ticket-analyzer", ' ', "v0.20");
26+
auto cmd = TCLAP::CmdLine("ticket-analyzer", ' ', "v0.21");
2727
auto const verboseArg = TCLAP::SwitchArg(
2828
"v", "verbose",
2929
"More verbose debug logging",

0 commit comments

Comments
 (0)