-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (64 loc) · 2.17 KB
/
CMakeLists.txt
File metadata and controls
90 lines (64 loc) · 2.17 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 3.15)
project(group4-polyfill CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_library(ccitt_g4_tiff
# src/third_party/pdfium/core/fxcrt/fx_memory_pa.cpp
src/third_party/pdfium/core/fxcrt/fx_memory_malloc.cpp
src/third_party/pdfium/core/fxcrt/fx_memory.h
src/third_party/pdfium/core/fxcrt/fx_memory.cpp
src/third_party/pdfium/core/fxcrt/debug/alias.h
src/third_party/pdfium/core/fxcrt/debug/alias.cc
src/third_party/pdfium/core/fxge/calculate_pitch.h
src/third_party/pdfium/core/fxge/calculate_pitch.cpp
src/third_party/pdfium/core/fxcodec/scanlinedecoder.h
src/third_party/pdfium/core/fxcodec/scanlinedecoder.cpp
src/third_party/pdfium/core/fxcodec/fax/faxmodule.cpp
src/ccitt_g4.cpp
)
target_include_directories(ccitt_g4_tiff PUBLIC
include
# src/build/build_config.h for pdfium
src
src/third_party/pdfium
)
target_compile_options(ccitt_g4_tiff PRIVATE
# -std=c++20
# clang
# -stdlib=libc++
# -D_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
)
if(EMSCRIPTEN)
add_executable(group4-polyfill
tools/bmp_encoder.cpp
tools/tiff_to_bmp.cpp
)
target_link_libraries(group4-polyfill PRIVATE
ccitt_g4_tiff
)
# see also
# https://github.com/paulocoutinhox/pdfium-lib/blob/master/modules/wasm.py
target_link_options(group4-polyfill PRIVATE
"-sWASM=1"
"-sMODULARIZE=1"
"-sEXPORT_NAME=create_group4_polyfill_module"
"-sALLOW_MEMORY_GROWTH=1"
"-sEXPORTED_FUNCTIONS=['_tiff_to_bmp','_tiff_free','_malloc','_free']"
"-sEXPORTED_RUNTIME_METHODS=['cwrap','HEAPU8','HEAPU32']"
"-sNO_DISABLE_EXCEPTION_CATCHING"
# WONTFIX this will never work over the file protocol
# Access to fetch at 'file:...' from origin 'null' has been blocked by CORS policy
# "-sSINGLE_FILE=1"
# "-sMINIMAL_RUNTIME=1"
)
else()
add_executable(group4_to_bmp
tools/tiff_cli.cpp
tools/bmp_encoder.cpp
tools/tiff_to_bmp.cpp
)
target_link_libraries(group4_to_bmp PRIVATE
ccitt_g4_tiff
)
endif()