forked from google/libultrahdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
103 lines (86 loc) · 1.88 KB
/
meson.build
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
91
92
93
94
95
96
97
98
99
100
101
102
103
project(
'libultrahdr-wasm',
'cpp',
version: '1.0.0',
meson_version: '>=0.63.0',
default_options: [
'warning_level=3',
'cpp_std=c++20'
],
)
cargs = []
add_global_arguments('-DUSE_BIG_ENDIAN_IN_ICC=false', language: 'cpp')
add_global_arguments('-DUSE_BIG_ENDIAN_IN_MPF=false', language: 'cpp')
deps = [
dependency('libturbojpeg', disabler: true, required: true, static: true)
]
subdir('third_party/image_io')
sources = files(
'lib/gainmapmath.cpp',
'lib/icc.cpp',
'lib/jpegr.cpp',
'lib/jpegrutils.cpp',
'lib/jpegencoderhelper.cpp',
'lib/jpegdecoderhelper.cpp',
'lib/multipictureformat.cpp'
)
sources += image_io_lib
lib_ultra_hdr_inc = include_directories(
'lib'
)
libultrahdr_lib = static_library(
'libultrahdr',
sources,
include_directories: [image_io_inc, lib_ultra_hdr_inc],
dependencies: deps,
c_args: cargs,
install: false
)
libultrahdr_dep = declare_dependency(
link_with: libultrahdr_lib,
)
link_args = [
'-sALLOW_MEMORY_GROWTH',
'--bind',
'--embind-emit-tsd=libultrahdr.d.ts'
]
# release
executable(
'libultrahdr',
'libultrahdr-wasm.cpp',
dependencies: [deps, libultrahdr_dep],
include_directories: lib_ultra_hdr_inc,
link_args: link_args
)
# release esm
executable(
'libultrahdr-esm',
'libultrahdr-wasm.cpp',
dependencies: [deps, libultrahdr_dep],
include_directories: lib_ultra_hdr_inc,
link_args: [
link_args,
'-sMODULARIZE',
'-sUSE_ES6_IMPORT_META',
'-sEXPORT_ES6'
]
)
# debug
executable(
'libultrahdr-debug',
'libultrahdr-wasm.cpp',
dependencies: [deps, libultrahdr_dep],
include_directories: lib_ultra_hdr_inc,
link_args: [
link_args,
'-gsource-map',
'-sLOAD_SOURCE_MAP',
'-sNO_DISABLE_EXCEPTION_CATCHING',
'-sMODULARIZE',
'-sUSE_ES6_IMPORT_META',
'-sEXPORT_ES6'
]
)
# npm pack doesn't work otherwise
fs = import('fs')
fs.copyfile('.npmignore', '.npmignore')