-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRebol-Blend2D.nest
385 lines (371 loc) · 12.7 KB
/
Rebol-Blend2D.nest
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
;~ Siskin project nest file ~;
github: @asmjit
github: @blend2d
;github: blend2d/blend2d-samples
compiler: gcc
needs: cmake
#if Windows? [ define: _CRT_SECURE_NO_WARNINGS upx: on needs: msbuild]
#if macOS? [ define: TO_OSX define: HAS_BOOL]
#if Linux? [ define: TO_LINUX ]
target-x86: [
arch: x86
#if Windows? [ defines: [ TO_WIN32 _WIN32 ] ]
#if Linux? [ defines: [ TO_LINUX_X86 ] ]
]
target-x64: [
arch: x64
defines: [
_FILE_OFFSET_BITS=64
__LP64__ ; has long (integer) 64 bits
]
#if Windows? [ defines: [ TO_WIN32_X64 _WIN32 ] ]
#if Linux? [ defines: [ TO_LINUX_X64 ] ]
#if macOS? [ defines: [ TO_OSX_X64 ] flags: ["-arch x86_64"] ]
]
target-arm64: [
arch: arm64
;flags: ["-arch arm64"]
flags: "-target arm64-apple-darwin"
define: _FILE_OFFSET_BITS=64
define: __LP64__ ; has long (integer) 64 bits
define: __arm64__
define: TO_OSX_X64
]
include: %blend2d/src/
b2d-lib: [
defines: [
;BL_BUILD_STATIC
;BL_BUILD_OPT_SSE2
;BL_BUILD_OPT_SSE3
;BL_BUILD_OPT_SSSE3
;BL_BUILD_OPT_SSE4_1
;BL_BUILD_OPT_SSE4_2
;BL_BUILD_OPT_AVX
;BL_BUILD_OPT_AVX2
;_UNICODE
;ASMJIT_BUILD_EMBED
;ASMJIT_BUILD_STATIC
;BL_BUILD_TEST
]
]
r3-extension: [
source: %src/
files: only [
%blend2d-rebol-extension.c
%blend2d-command.c
%blend2d-command-draw.c
%blend2d-command-path.c
%blend2d-command-font.c
%blend2d-command-image.c
%blend2d-command-info.c
;%blend2d-command-draw-test.c
]
include: [
%src/
%rebol/src/include/
]
defines: [ENDIAN_LITTLE]
cflags: [-fpermissive]
flags: [-O2 shared]
#if Posix? [
cflags: [-fPIC -pthread ]
;libraries: [%pthread]
]
do %src/blend2d-rebol-extension.r3
]
b2d-files: [
%blend2d/src/blend2d/api-globals.cpp
%blend2d/src/blend2d/api-nocxx.cpp
%blend2d/src/blend2d/array.cpp
%blend2d/src/blend2d/bitset.cpp
%blend2d/src/blend2d/compop.cpp
%blend2d/src/blend2d/context.cpp
%blend2d/src/blend2d/filesystem.cpp
%blend2d/src/blend2d/font.cpp
%blend2d/src/blend2d/fontmanager.cpp
%blend2d/src/blend2d/format.cpp
%blend2d/src/blend2d/geometry.cpp
%blend2d/src/blend2d/glyphbuffer.cpp
%blend2d/src/blend2d/gradient.cpp
%blend2d/src/blend2d/image.cpp
%blend2d/src/blend2d/imagecodec.cpp
%blend2d/src/blend2d/imagescale.cpp
%blend2d/src/blend2d/math.cpp
%blend2d/src/blend2d/matrix.cpp
%blend2d/src/blend2d/matrix_avx.cpp
%blend2d/src/blend2d/matrix_sse2.cpp
%blend2d/src/blend2d/object.cpp
%blend2d/src/blend2d/path.cpp
%blend2d/src/blend2d/pathstroke.cpp
%blend2d/src/blend2d/pattern.cpp
%blend2d/src/blend2d/pixelconverter.cpp
%blend2d/src/blend2d/pixelconverter_avx2.cpp
%blend2d/src/blend2d/pixelconverter_sse2.cpp
%blend2d/src/blend2d/pixelconverter_ssse3.cpp
%blend2d/src/blend2d/random.cpp
%blend2d/src/blend2d/rgba.cpp
%blend2d/src/blend2d/runtime.cpp
%blend2d/src/blend2d/string.cpp
%blend2d/src/blend2d/tables.cpp
%blend2d/src/blend2d/trace.cpp
%blend2d/src/blend2d/unicode.cpp
%blend2d/src/blend2d/var.cpp
%blend2d/src/blend2d/zeroallocator.cpp
%blend2d/src/blend2d/codec/bmpcodec.cpp
%blend2d/src/blend2d/codec/jpegcodec.cpp
%blend2d/src/blend2d/codec/jpeghuffman.cpp
%blend2d/src/blend2d/codec/jpegops.cpp
%blend2d/src/blend2d/codec/jpegops_sse2.cpp
%blend2d/src/blend2d/codec/pngcodec.cpp
%blend2d/src/blend2d/codec/pngops.cpp
%blend2d/src/blend2d/codec/pngops_sse2.cpp
%blend2d/src/blend2d/compression/checksum.cpp
%blend2d/src/blend2d/compression/deflatedecoder.cpp
%blend2d/src/blend2d/compression/deflateencoder.cpp
%blend2d/src/blend2d/opentype/otcff.cpp
%blend2d/src/blend2d/opentype/otcmap.cpp
%blend2d/src/blend2d/opentype/otcore.cpp
%blend2d/src/blend2d/opentype/otface.cpp
%blend2d/src/blend2d/opentype/otglyf.cpp
%blend2d/src/blend2d/opentype/otkern.cpp
%blend2d/src/blend2d/opentype/otlayout.cpp
%blend2d/src/blend2d/opentype/otmetrics.cpp
%blend2d/src/blend2d/opentype/otname.cpp
%blend2d/src/blend2d/pipeline/pipedefs.cpp
%blend2d/src/blend2d/pipeline/piperuntime.cpp
%blend2d/src/blend2d/pipeline/jit/compoppart.cpp
%blend2d/src/blend2d/pipeline/jit/fetchgradientpart.cpp
%blend2d/src/blend2d/pipeline/jit/fetchpart.cpp
%blend2d/src/blend2d/pipeline/jit/fetchpatternpart.cpp
%blend2d/src/blend2d/pipeline/jit/fetchpixelptrpart.cpp
%blend2d/src/blend2d/pipeline/jit/fetchsolidpart.cpp
%blend2d/src/blend2d/pipeline/jit/fetchutils.cpp
%blend2d/src/blend2d/pipeline/jit/fillpart.cpp
%blend2d/src/blend2d/pipeline/jit/pipecompiler.cpp
%blend2d/src/blend2d/pipeline/jit/pipegencore.cpp
%blend2d/src/blend2d/pipeline/jit/pipegenruntime.cpp
%blend2d/src/blend2d/pipeline/jit/pipepart.cpp
%blend2d/src/blend2d/pipeline/reference/fixedpiperuntime.cpp
%blend2d/src/blend2d/pixelops/interpolation.cpp
%blend2d/src/blend2d/pixelops/interpolation_avx2.cpp
%blend2d/src/blend2d/pixelops/interpolation_sse2.cpp
%blend2d/src/blend2d/pixelops/funcs.cpp
%blend2d/src/blend2d/pixelops/scalar.cpp
%blend2d/src/blend2d/raster/analyticrasterizer.cpp
%blend2d/src/blend2d/raster/rastercontext.cpp
%blend2d/src/blend2d/raster/rastercontextops.cpp
%blend2d/src/blend2d/raster/renderfetchdata.cpp
%blend2d/src/blend2d/raster/rendertargetinfo.cpp
%blend2d/src/blend2d/raster/workdata.cpp
%blend2d/src/blend2d/raster/workermanager.cpp
%blend2d/src/blend2d/raster/workerproc.cpp
%blend2d/src/blend2d/raster/workersynchronization.cpp
%blend2d/src/blend2d/support/algorithm.cpp
%blend2d/src/blend2d/support/arenaallocator.cpp
%blend2d/src/blend2d/support/arenahashmap.cpp
%blend2d/src/blend2d/support/arenalist.cpp
%blend2d/src/blend2d/support/arenatree.cpp
%blend2d/src/blend2d/support/bitops.cpp
%blend2d/src/blend2d/support/intops.cpp
%blend2d/src/blend2d/support/memops.cpp
%blend2d/src/blend2d/support/scopedallocator.cpp
%blend2d/src/blend2d/threading/futex.cpp
%blend2d/src/blend2d/threading/thread.cpp
%blend2d/src/blend2d/threading/threadpool.cpp
%blend2d/src/blend2d/threading/uniqueidgenerator.cpp
%asmjit/src/asmjit/core/archtraits.cpp
%asmjit/src/asmjit/core/assembler.cpp
%asmjit/src/asmjit/core/builder.cpp
%asmjit/src/asmjit/core/codeholder.cpp
%asmjit/src/asmjit/core/codewriter.cpp
%asmjit/src/asmjit/core/compiler.cpp
%asmjit/src/asmjit/core/constpool.cpp
%asmjit/src/asmjit/core/cpuinfo.cpp
%asmjit/src/asmjit/core/emithelper.cpp
%asmjit/src/asmjit/core/emitter.cpp
%asmjit/src/asmjit/core/emitterutils.cpp
%asmjit/src/asmjit/core/environment.cpp
%asmjit/src/asmjit/core/errorhandler.cpp
%asmjit/src/asmjit/core/formatter.cpp
%asmjit/src/asmjit/core/func.cpp
%asmjit/src/asmjit/core/funcargscontext.cpp
%asmjit/src/asmjit/core/globals.cpp
%asmjit/src/asmjit/core/inst.cpp
%asmjit/src/asmjit/core/jitallocator.cpp
%asmjit/src/asmjit/core/jitruntime.cpp
%asmjit/src/asmjit/core/logger.cpp
%asmjit/src/asmjit/core/operand.cpp
%asmjit/src/asmjit/core/osutils.cpp
%asmjit/src/asmjit/core/ralocal.cpp
%asmjit/src/asmjit/core/rapass.cpp
%asmjit/src/asmjit/core/rastack.cpp
%asmjit/src/asmjit/core/string.cpp
%asmjit/src/asmjit/core/support.cpp
%asmjit/src/asmjit/core/target.cpp
%asmjit/src/asmjit/core/type.cpp
%asmjit/src/asmjit/core/virtmem.cpp
%asmjit/src/asmjit/core/zone.cpp
%asmjit/src/asmjit/core/zonehash.cpp
%asmjit/src/asmjit/core/zonelist.cpp
%asmjit/src/asmjit/core/zonestack.cpp
%asmjit/src/asmjit/core/zonetree.cpp
%asmjit/src/asmjit/core/zonevector.cpp
%asmjit/src/asmjit/x86/x86assembler.cpp
%asmjit/src/asmjit/x86/x86builder.cpp
%asmjit/src/asmjit/x86/x86compiler.cpp
%asmjit/src/asmjit/x86/x86emithelper.cpp
%asmjit/src/asmjit/x86/x86formatter.cpp
%asmjit/src/asmjit/x86/x86func.cpp
%asmjit/src/asmjit/x86/x86instdb.cpp
%asmjit/src/asmjit/x86/x86instapi.cpp
%asmjit/src/asmjit/x86/x86operand.cpp
%asmjit/src/asmjit/x86/x86rapass.cpp
]
eggs: only [
#if Windows? [
"Make Blend2D static library (cmake) - x64" [
arch: x64
cmd %_static/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DBLEND2D_STATIC=TRUE -DASMJIT_DIR=../asmjit/"
cmd %_static/ {msbuild blend2d.sln /p:Configuration=Release /p:Platform=x64}
]
"Make Blend2D dynamic library (cmake) - x64" [
arch: x64
cmd %_dynamic/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DBLEND2D_STATIC=FALSE -DASMJIT_DIR=../asmjit/"
cmd %_dynamic/ {msbuild blend2d.sln /p:Configuration=Release /p:Platform=x64}
]
"Make Blend2D test" [
arch: x64
cmd %_test/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DBLEND2D_TEST=1"
cmd %_test/ {msbuild blend2d.sln /p:Configuration=Release /p:Platform=x64}
]
"Rebol/Blend2D extension - x64" [
:r3-extension
:target-x64
#if Windows? [upx: on]
defines: [BL_STATIC BLEND2D_BUILD_NO_CXX_LIB=1]
name: %blend2d-windows-x64
libraries: [%_static/Release/blend2d]
]
]
#if macOS? [
"Make Blend2D static library (cmake) - x64" [
arch: x64
cmd %_static_x64/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF -DBLEND2D_STATIC=TRUE -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_OSX_SYSROOT=macosx -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
cmd %_static_x64/ {cmake --build .}
]
"Make Blend2D static library (cmake) - arm64" [
arch: arm64
cmd %_static_arm64/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF -DBLEND2D_STATIC=TRUE -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_OSX_SYSROOT=macosx -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
cmd %_static_arm64/ {cmake --build .}
]
; "Make Blend2D dynamic library (cmake) - x64" [
; arch: x64
; cmd %_dynamic_x64/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF -DBLEND2D_STATIC=FALSE -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_OSX_SYSROOT=macosx -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
; cmd %_dynamic_x64/ {cmake --build .}
; ]
; "Make 64bit Blend2D static library (experiment without cmake)" [
; name: %libblend2d
; :target-x64
; compiler: clang
; files: :b2d-files
; ;file: %blend2d/src/blend2d/compression/deflateencoder.cpp
; ;file: %blend2d/src/blend2d/pixelconverter_avx2.cpp
; ;file: %blend2d/src/blend2d/api-globals.cpp
; includes: [
; %asmjit/src/
; ]
; defines: [
; BL_STATIC
; BL_BUILD_OPT_AVX2
; BL_BUILD_NO_STDCXX
; ASMJIT_STATIC
; ASMJIT_NO_STDCXX
; NDEBUG
; ]
; cflags: [
; -std=c++11
; -O2
; -Wall
; -Wextra
; ; -Wconversion
; -fno-math-errno
; -fno-threadsafe-statics
; -fmerge-all-constants
;
; -fno-exceptions
; -fno-rtti
; -fno-finite-math-only
; ;-msse2
; -mavx2
; -ftree-vectorize;
;
; ; -fno-semantic-interposition ; Do not allow semantic interposition (Clang uses this by default).
; "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk"
; ]
; flag: -mmacosx-version-min=10.9
; ;flag: static
; ;flag: "-arch x86_64"
; cflags: [-fPIC -pthread ]
; ;lflags: [-static-libstdc++]
; libraries: [%pthread %c %m]
;
; ;files: [
; ; %src/blend2d-rebol-extension.c
; ; %src/blend2d-command.c
; ; %src/blend2d-command-draw.c
; ; %src/blend2d-command-path.c
; ; %src/blend2d-command-font.c
; ; %src/blend2d-command-image.c
; ; %src/blend2d-command-info.c
; ; ;%blend2d-command-draw-test.c
; ;]
; ;include: [
; ; %src/
; ; %rebol/src/include/
; ;]
; flags: [shared]
; ]
"Rebol/Blend2D extension - x64" [
:r3-extension
:target-x64
compiler: clang
flag: -dynamiclib
flag: -mmacosx-version-min=10.9
defines: [BL_STATIC BLEND2D_BUILD_NO_CXX_LIB=1]
name: %blend2d-macos-x64
libraries: [%c %m %stdc++ %_static_x64/ %blend2d]
]
"Rebol/Blend2D extension - arm64 (only partial support in B2D!)" [
:r3-extension
:target-arm64
compiler: clang
flag: -dynamiclib
flag: -mmacosx-version-min=10.9
defines: [BL_STATIC BLEND2D_BUILD_NO_CXX_LIB=1]
name: %blend2d-macos-arm64
libraries: [%c %m %stdc++ %_static_arm64/ %blend2d]
]
"Test" [
name: %test
file: %test/test.c
compiler: clang
:target-x64
libraries: [%blend2d]
]
]
#if Linux? [
"Make 64bit Blend2D static library" [
arch: x64
cmd %_static_linux/ "cmake ../blend2d/ -DCMAKE_BUILD_TYPE=Release -DBLEND2D_STATIC=TRUE -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DASMJIT_DIR=../asmjit"
cmd %_static_linux/ {cmake --build .}
]
"Rebol extension" [
:r3-extension
:target-x64
compiler: clang
defines: [BL_STATIC BLEND2D_BUILD_NO_CXX_LIB=1]
name: %blend2d-linux-x64
libraries: [%c %m %stdc++ %_static_linux/ %blend2d]
]
]
]