• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14if (defined(ohos_lite)) {  # is on lite Os for ipcamera
15  import("//build/lite/config/component/lite_component.gni")
16
17  lite_component("jerry_engine") {
18    features = [
19      "jerry-core",
20      "jerry-ext",
21      "jerry-port/default:jerry-port-default",
22    ]
23    if (ohos_kernel_type != "liteos_m") {
24      features += [ "jerry_libm" ]
25    }
26  }
27} else {
28  import("//build/ohos.gni")
29  import("//third_party/jerryscript/engine.gni")
30  config("jerryscript_config") {
31    defines = [
32      "JERRY_COMMIT_HASH=\"ignored\"",
33      "JERRY_NDEBUG",
34      "JERRY_HEAPDUMP",
35      "JERRY_REF_TRACKER",
36    ]
37    defines += [
38      "JERRY_SNAPSHOT_SAVE=${jerryscript_jerry_snapshot_save}",
39      "JERRY_ES2015=${jerryscript_jerry_es2015}",
40      "JERRY_ES2015_BUILTIN_TYPEDARRAY=${jerryscript_jerry_es2015_builtin_typedarray}",
41      "JERRY_ES2015_BUILTIN_SET=${jerryscript_jerry_es2015_builtin_set}",
42      "JERRY_ES2015_BUILTIN_PROMISE=${jerryscript_jerry_es2015_builtin_promise}",
43      "JERRY_ES2015_BUILTIN_PROXY=${jerryscript_jerry_es2015_builtin_proxy}",
44      "JERRY_ES2015_MODULE_SYSTEM=${jerryscript_jerry_es2015_module_system}",
45      "JERRY_ES2015_BUILTIN_MAP=${jerryscript_jerry_es2015_builtin_map}",
46      "JERRY_ES2015_BUILTIN_WEAKMAP=${jerryscript_jerry_es2015_builtin_weakmap}",
47      "JERRY_ES2015_BUILTIN_WEAKSET=${jerryscript_jerry_es2015_builtin_weakset}",
48      "JERRY_ES2015_BUILTIN_DATAVIEW=${jerryscript_jerry_es2015_builtin_dataview}",
49      "JERRY_ES2015_BUILTIN_REFLECT=${jerryscript_jerry_es2015_builtin_reflect}",
50    ]
51    cflags = [
52      "-Wno-unused-function",
53      "-Wno-sign-compare",
54      "-Wno-implicit-fallthrough",
55    ]
56    include_dirs = [ "." ]
57  }
58
59  config("jerryscript_simulator") {
60    defines = [
61      "JERRY_FUNCTION_BACKTRACE",
62      "JERRY_FUNCTION_NAME",
63      "JERRY_HEAPDUMP",
64      "JERRY_NDEBUG",
65      "JERRY_REF_TRACKER",
66    ]
67    defines += [
68      "JERRY_CPOINTER_32_BIT=${jerryscript_jerry_cpointer_32_bit}",
69      "JERRY_DEBUGGER=${jerryscript_jerry_debugger}",
70      "JERRY_GC_LIMIT=${jerryscript_jerry_gc_limit}",
71      "JERRY_LINE_INFO=${jerryscript_jerry_line_info}",
72      "JERRY_MEM_GC_BEFORE_EACH_ALLOC=${jerryscript_jerry_mem_gc_before_each_alloc}",
73      "JERRY_PARSER=${jerryscript_jerry_parser}",
74      "JERRY_PARSER_DUMP_BYTE_CODE=${jerryscript_jerry_parser_dump_byte_code}",
75      "JERRY_REGEXP_DUMP_BYTE_CODE=${jerryscript_jerry_regexp_dump_byte_code}",
76      "JERRY_REGEXP_STRICT_MODE=${jerryscript_jerry_regexp_strict_mode}",
77      "JERRY_STACK_LIMIT=${jerryscript_jerry_stack_limit}",
78      "JERRY_SYSTEM_ALLOCATOR=${jerryscript_jerry_system_allocator}",
79      "JERRY_VALGRIND=${jerryscript_jerry_valgrind}",
80      "JERRY_VM_EXEC_STOP=${jerryscript_jerry_vm_exec_stop}",
81      "JERRY_ES2015=${jerryscript_jerry_es2015}",
82      "JERRY_ES2015_BUILTIN_TYPEDARRAY=${jerryscript_jerry_es2015_builtin_typedarray}",
83      "JERRY_ES2015_BUILTIN_SET=${jerryscript_jerry_es2015_builtin_set}",
84      "JERRY_ES2015_BUILTIN_PROMISE=${jerryscript_jerry_es2015_builtin_promise}",
85      "JERRY_ES2015_BUILTIN_PROXY=${jerryscript_jerry_es2015_builtin_proxy}",
86      "JERRY_ES2015_MODULE_SYSTEM=${jerryscript_jerry_es2015_module_system}",
87      "JERRY_ES2015_BUILTIN_MAP=${jerryscript_jerry_es2015_builtin_map}",
88      "JERRY_ES2015_BUILTIN_WEAKMAP=${jerryscript_jerry_es2015_builtin_weakmap}",
89      "JERRY_ES2015_BUILTIN_WEAKSET=${jerryscript_jerry_es2015_builtin_weakset}",
90      "JERRY_ES2015_BUILTIN_DATAVIEW=${jerryscript_jerry_es2015_builtin_dataview}",
91      "JERRY_ES2015_BUILTIN_REFLECT=${jerryscript_jerry_es2015_builtin_reflect}",
92    ]
93    if (jerryscript_enable_external_context == true) {
94      defines += [ "JERRY_EXTERNAL_CONTEXT=1" ]
95    }
96    defines += [ "INPUTJS_BUFFER_SIZE=${jerryscript_inputjs_buffer_size}" ]
97    defines += [ "SNAPSHOT_BUFFER_SIZE=${jerryscript_snapshot_buffer_size}" ]
98    defines += [ "BMS_TASK_HEAP_SIZE=${jerryscript_bms_task_heap_size}" ]
99    defines += [ "JS_TASK_HEAP_SIZE=${jerryscript_js_task_heap_size}" ]
100
101    cflags = [
102      "-Wno-unused-function",
103      "-Wno-sign-compare",
104      "-Wno-error",  # jerry add
105      "-Wno-implicit-fallthrough",
106    ]
107    include_dirs = [ "." ]
108  }
109
110  jerry_core_sources = [
111    "jerry-core/api/jerry-debugger-transport.c",
112    "jerry-core/api/jerry-debugger.c",
113    "jerry-core/api/jerry-snapshot.c",
114    "jerry-core/api/jerry.c",
115    "jerry-core/debugger/debugger.c",
116    "jerry-core/ecma/base/ecma-alloc.c",
117    "jerry-core/ecma/base/ecma-gc.c",
118    "jerry-core/ecma/base/ecma-helpers-collection.c",
119    "jerry-core/ecma/base/ecma-helpers-conversion.c",
120    "jerry-core/ecma/base/ecma-helpers-errol.c",
121    "jerry-core/ecma/base/ecma-helpers-external-pointers.c",
122    "jerry-core/ecma/base/ecma-helpers-number.c",
123    "jerry-core/ecma/base/ecma-helpers-string.c",
124    "jerry-core/ecma/base/ecma-helpers-value.c",
125    "jerry-core/ecma/base/ecma-helpers.c",
126    "jerry-core/ecma/base/ecma-init-finalize.c",
127    "jerry-core/ecma/base/ecma-lcache.c",
128    "jerry-core/ecma/base/ecma-literal-storage.c",
129    "jerry-core/ecma/base/ecma-module.c",
130    "jerry-core/ecma/base/ecma-property-hashmap.c",
131    "jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c",
132    "jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c",
133    "jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c",
134    "jerry-core/ecma/builtin-objects/ecma-builtin-array.c",
135    "jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.c",
136    "jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.c",
137    "jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.c",
138    "jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c",
139    "jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.c",
140    "jerry-core/ecma/builtin-objects/ecma-builtin-dataview.c",
141    "jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c",
142    "jerry-core/ecma/builtin-objects/ecma-builtin-date.c",
143    "jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.c",
144    "jerry-core/ecma/builtin-objects/ecma-builtin-error.c",
145    "jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.c",
146    "jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c",
147    "jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c",
148    "jerry-core/ecma/builtin-objects/ecma-builtin-function.c",
149    "jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c",
150    "jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c",
151    "jerry-core/ecma/builtin-objects/ecma-builtin-generator.c",
152    "jerry-core/ecma/builtin-objects/ecma-builtin-global.c",
153    "jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c",
154    "jerry-core/ecma/builtin-objects/ecma-builtin-helpers-error.c",
155    "jerry-core/ecma/builtin-objects/ecma-builtin-helpers-json.c",
156    "jerry-core/ecma/builtin-objects/ecma-builtin-helpers-sort.c",
157    "jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c",
158    "jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c",
159    "jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c",
160    "jerry-core/ecma/builtin-objects/ecma-builtin-json.c",
161    "jerry-core/ecma/builtin-objects/ecma-builtin-map-iterator-prototype.c",
162    "jerry-core/ecma/builtin-objects/ecma-builtin-map-prototype.c",
163    "jerry-core/ecma/builtin-objects/ecma-builtin-map.c",
164    "jerry-core/ecma/builtin-objects/ecma-builtin-math.c",
165    "jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c",
166    "jerry-core/ecma/builtin-objects/ecma-builtin-number.c",
167    "jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c",
168    "jerry-core/ecma/builtin-objects/ecma-builtin-object.c",
169    "jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c",
170    "jerry-core/ecma/builtin-objects/ecma-builtin-promise.c",
171    "jerry-core/ecma/builtin-objects/ecma-builtin-proxy.c",
172    "jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.c",
173    "jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c",
174    "jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.c",
175    "jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c",
176    "jerry-core/ecma/builtin-objects/ecma-builtin-reflect.c",
177    "jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c",
178    "jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c",
179    "jerry-core/ecma/builtin-objects/ecma-builtin-set-iterator-prototype.c",
180    "jerry-core/ecma/builtin-objects/ecma-builtin-set-prototype.c",
181    "jerry-core/ecma/builtin-objects/ecma-builtin-set.c",
182    "jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c",
183    "jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c",
184    "jerry-core/ecma/builtin-objects/ecma-builtin-string.c",
185    "jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c",
186    "jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c",
187    "jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.c",
188    "jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c",
189    "jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.c",
190    "jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.c",
191    "jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c",
192    "jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.c",
193    "jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c",
194    "jerry-core/ecma/builtin-objects/ecma-builtin-weakmap-prototype.c",
195    "jerry-core/ecma/builtin-objects/ecma-builtin-weakmap.c",
196    "jerry-core/ecma/builtin-objects/ecma-builtin-weakset-prototype.c",
197    "jerry-core/ecma/builtin-objects/ecma-builtin-weakset.c",
198    "jerry-core/ecma/builtin-objects/ecma-builtins.c",
199    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.c",
200    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.c",
201    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c",
202    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c",
203    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.c",
204    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.c",
205    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.c",
206    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.c",
207    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.c",
208    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.c",
209    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-helpers.c",
210    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c",
211    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.c",
212    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.c",
213    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.c",
214    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.c",
215    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.c",
216    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.c",
217    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.c",
218    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.c",
219    "jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.c",
220    "jerry-core/ecma/operations/ecma-array-object.c",
221    "jerry-core/ecma/operations/ecma-arraybuffer-object.c",
222    "jerry-core/ecma/operations/ecma-boolean-object.c",
223    "jerry-core/ecma/operations/ecma-comparison.c",
224    "jerry-core/ecma/operations/ecma-container-object.c",
225    "jerry-core/ecma/operations/ecma-conversion.c",
226    "jerry-core/ecma/operations/ecma-dataview-object.c",
227    "jerry-core/ecma/operations/ecma-eval.c",
228    "jerry-core/ecma/operations/ecma-exceptions.c",
229    "jerry-core/ecma/operations/ecma-function-object.c",
230    "jerry-core/ecma/operations/ecma-get-put-value.c",
231    "jerry-core/ecma/operations/ecma-iterator-object.c",
232    "jerry-core/ecma/operations/ecma-jobqueue.c",
233    "jerry-core/ecma/operations/ecma-lex-env.c",
234    "jerry-core/ecma/operations/ecma-number-arithmetic.c",
235    "jerry-core/ecma/operations/ecma-number-object.c",
236    "jerry-core/ecma/operations/ecma-objects-arguments.c",
237    "jerry-core/ecma/operations/ecma-objects-general.c",
238    "jerry-core/ecma/operations/ecma-objects.c",
239    "jerry-core/ecma/operations/ecma-promise-object.c",
240    "jerry-core/ecma/operations/ecma-proxy-object.c",
241    "jerry-core/ecma/operations/ecma-reference.c",
242    "jerry-core/ecma/operations/ecma-regexp-object.c",
243    "jerry-core/ecma/operations/ecma-string-object.c",
244    "jerry-core/ecma/operations/ecma-symbol-object.c",
245    "jerry-core/ecma/operations/ecma-typedarray-object.c",
246    "jerry-core/ext/ext-utils.c",
247    "jerry-core/ext/heapdump.c",
248    "jerry-core/ext/tracker.c",
249    "jerry-core/jcontext/jcontext.c",
250    "jerry-core/jmem/jmem-allocator.c",
251    "jerry-core/jmem/jmem-heap.c",
252    "jerry-core/jmem/jmem-poolman.c",
253    "jerry-core/jrt/jrt-fatals.c",
254    "jerry-core/lit/lit-char-helpers.c",
255    "jerry-core/lit/lit-magic-strings.c",
256    "jerry-core/lit/lit-strings.c",
257    "jerry-core/parser/js/byte-code.c",
258    "jerry-core/parser/js/common.c",
259    "jerry-core/parser/js/js-lexer.c",
260    "jerry-core/parser/js/js-parser-expr.c",
261    "jerry-core/parser/js/js-parser-mem.c",
262    "jerry-core/parser/js/js-parser-module.c",
263    "jerry-core/parser/js/js-parser-statm.c",
264    "jerry-core/parser/js/js-parser-tagged-template-literal.c",
265    "jerry-core/parser/js/js-parser-util.c",
266    "jerry-core/parser/js/js-parser.c",
267    "jerry-core/parser/js/js-scanner-ops.c",
268    "jerry-core/parser/js/js-scanner-util.c",
269    "jerry-core/parser/js/js-scanner.c",
270    "jerry-core/parser/regexp/re-bytecode.c",
271    "jerry-core/parser/regexp/re-compiler.c",
272    "jerry-core/parser/regexp/re-parser.c",
273    "jerry-core/vm/opcodes-ecma-arithmetics.c",
274    "jerry-core/vm/opcodes-ecma-bitwise.c",
275    "jerry-core/vm/opcodes-ecma-relational-equality.c",
276    "jerry-core/vm/opcodes.c",
277    "jerry-core/vm/vm-stack.c",
278    "jerry-core/vm/vm-utils.c",
279    "jerry-core/vm/vm.c",
280  ]
281
282  jerry_core_include_dirs = [
283    "jerry-core/include",
284    "jerry-core/api",
285    "jerry-core/debugger",
286    "jerry-core/ecma/base",
287    "jerry-core/ecma/builtin-objects",
288    "jerry-core/ecma/builtin-objects/typedarray",
289    "jerry-core/ecma/operations",
290    "jerry-core/ext",
291    "jerry-core/jcontext",
292    "jerry-core/jmem",
293    "jerry-core/jrt",
294    "jerry-core/lit",
295    "jerry-core/parser",
296    "jerry-core/parser/js",
297    "jerry-core/parser/regexp",
298    "jerry-core/vm",
299    "jerry-core",
300  ]
301
302  jerry_ext_sources = [
303    "jerry-ext/arg/arg-js-iterator-helper.c",
304    "jerry-ext/arg/arg-transform-functions.c",
305    "jerry-ext/arg/arg.c",
306    "jerry-ext/debugger/debugger-common.c",
307    "jerry-ext/debugger/debugger-rp.c",
308    "jerry-ext/debugger/debugger-serial.c",
309    "jerry-ext/debugger/debugger-sha1.c",
310    "jerry-ext/debugger/debugger-tcp.c",
311    "jerry-ext/debugger/debugger-ws.c",
312    "jerry-ext/handle-scope/handle-scope-allocator.c",
313    "jerry-ext/handle-scope/handle-scope.c",
314    "jerry-ext/handler/handler-assert.c",
315    "jerry-ext/handler/handler-gc.c",
316    "jerry-ext/handler/handler-print.c",
317    "jerry-ext/handler/handler-register.c",
318    "jerry-ext/handler/handler-resource-name.c",
319    "jerry-ext/module/module.c",
320  ]
321  jerry_ext_include_dirs = [
322    "jerry-ext/include",
323    "jerry-ext/debugger",
324    "jerry-ext/common",
325    "jerry-ext/arg",
326    "jerry-ext/handle-scope",
327    "jerry-core/include",
328  ]
329
330  jerry_port_default_sources = [
331    "jerry-port/default/default-date.c",
332    "jerry-port/default/default-debugger.c",
333    "jerry-port/default/default-external-context.c",
334    "jerry-port/default/default-fatal.c",
335    "jerry-port/default/default-io.c",
336    "jerry-port/default/default-module.c",
337  ]
338  jerry_port_default_include_dirs = [
339    "jerry-port/default/include",
340    "jerry-core/include",
341  ]
342
343  jerry_libm_sources = [
344    "jerry-libm/acos.c",
345    "jerry-libm/acosh.c",
346    "jerry-libm/asin.c",
347    "jerry-libm/asinh.c",
348    "jerry-libm/atan.c",
349    "jerry-libm/atan2.c",
350    "jerry-libm/atanh.c",
351    "jerry-libm/cbrt.c",
352    "jerry-libm/ceil.c",
353    "jerry-libm/copysign.c",
354    "jerry-libm/cosh.c",
355    "jerry-libm/exp.c",
356    "jerry-libm/expm1.c",
357    "jerry-libm/fabs.c",
358    "jerry-libm/finite.c",
359    "jerry-libm/floor.c",
360    "jerry-libm/fmod.c",
361    "jerry-libm/isnan.c",
362    "jerry-libm/log.c",
363    "jerry-libm/log10.c",
364    "jerry-libm/log1p.c",
365    "jerry-libm/log2.c",
366    "jerry-libm/nextafter.c",
367    "jerry-libm/pow.c",
368    "jerry-libm/scalbn.c",
369    "jerry-libm/sinh.c",
370    "jerry-libm/sqrt.c",
371    "jerry-libm/tanh.c",
372    "jerry-libm/trig.c",
373  ]
374  jerry_libm_include_dirs = [ "jerry-libm/include" ]
375
376  jerry_sources = [
377    "jerry-main/cli.c",
378    "jerry-main/main-unix.c",
379  ]
380  jerry_include_dirs = [
381    "jerry-ext",
382    "jerry-ext/common",
383    "jerry-ext/debugger",
384    "jerry-ext/handle-scope",
385    "jerry-ext/include/jerryscript-ext",
386    "jerry-ext/include",
387    "jerry-libm",
388    "jerry-debugger",
389    "jerry-port",
390    "jerry-main",
391    "jerry-core",
392    "jerry-port/default/include",
393    "jerry-core/ecma/base",
394    "jerry-core/ecma/operations",
395    "jerry-core/ecma/builtin-objects",
396    "jerry-core/vm",
397    "jerry-core/jcontext",
398    "jerry-core/jmem",
399    "jerry-core/parser/js",
400    "jerry-core/parser/regexp",
401    "jerry-core/jrt",
402    "jerry-core/lit",
403    "jerry-core/include",
404    "jerry-core/ecma/builtin-objects/",
405  ]
406
407  jerry_snapshot_sources = [
408    "jerry-main/cli.c",
409    "jerry-main/main-unix-snapshot.c",
410  ]
411  jerry_snapshot_include_dirs = [
412    "jerry-ext",
413    "jerry-ext/common",
414    "jerry-ext/debugger",
415    "jerry-ext/handle-scope",
416    "jerry-ext/include/jerryscript-ext",
417    "jerry-ext/include",
418    "jerry-libm",
419    "jerry-debugger",
420    "jerry-port",
421    "jerry-main",
422    "jerry-core",
423    "jerry-port/default/include",
424    "jerry-core/ecma/base",
425    "jerry-core/ecma/operations",
426    "jerry-core/ecma/builtin-objects",
427    "jerry-core/vm",
428    "jerry-core/jcontext",
429    "jerry-core/jmem",
430    "jerry-core/parser/js",
431    "jerry-core/parser/regexp",
432    "jerry-core/jrt",
433    "jerry-core/lit",
434    "jerry-core/include",
435    "jerry-core/ecma/builtin-objects/",
436  ]
437
438  ohos_executable("jerry") {
439    configs = [ ":jerryscript_config" ]
440    sources = jerry_core_sources
441    sources += jerry_ext_sources
442    sources += jerry_libm_sources
443    sources += jerry_port_default_sources
444    sources += jerry_sources
445
446    include_dirs = jerry_core_include_dirs
447    include_dirs += jerry_ext_include_dirs
448    include_dirs += jerry_libm_include_dirs
449    include_dirs += jerry_port_default_include_dirs
450    include_dirs += jerry_include_dirs
451  }
452
453  ohos_executable("jerry-snapshot") {
454    configs = [ ":jerryscript_config" ]
455    sources = jerry_core_sources
456    sources += jerry_libm_sources
457    sources += jerry_port_default_sources
458    sources += jerry_snapshot_sources
459
460    include_dirs = jerry_core_include_dirs
461    include_dirs += jerry_libm_include_dirs
462    include_dirs += jerry_port_default_include_dirs
463    include_dirs += jerry_snapshot_include_dirs
464  }
465
466  ohos_static_library("libjerryscript") {
467    configs = [ ":jerryscript_simulator" ]
468    sources = jerry_core_sources
469    sources += jerry_ext_sources
470    sources += jerry_libm_sources
471    sources += jerry_port_default_sources
472
473    include_dirs = jerry_core_include_dirs
474    include_dirs += jerry_ext_include_dirs
475    include_dirs += jerry_libm_include_dirs
476    include_dirs += jerry_port_default_include_dirs
477  }
478}
479