• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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
14import("//build/ohos.gni")
15
16config("qjs_inner_config") {
17  cflags = [
18    "-Wno-sign-compare",
19    "-Wno-unused-variable",
20    "-Wno-unused-function",
21    "-Wno-missing-braces",
22    "-fvisibility=hidden",
23    "-fdata-sections",
24    "-ffunction-sections",
25    "-Os",
26    "-fsigned-char",
27  ]
28  include_dirs = [ "." ]
29}
30
31config("qjs_debug_config") {
32  include_dirs = [ "." ]
33  cflags = [ "-DENABLE_JS_DEBUG" ]
34  include_dirs += [ "//utils/native/base/include" ]
35}
36
37qjs_sources = [
38  "cutils.c",
39  "libbf.c",
40  "libregexp.c",
41  "libunicode.c",
42  "quickjs-libc.c",
43  "quickjs.c",
44]
45
46ohos_static_library("qjs_debugger") {
47  sources = qjs_sources
48  sources += [
49    "debugger.c",
50    "message_server.cpp",
51  ]
52  external_deps = []
53  if (!is_wearable_product) {
54    external_deps += [ "utils_base:utils" ]
55  }
56  if (is_standard_system) {
57    external_deps += [ "hiviewdfx_hilog_native:libhilog" ]
58  } else {
59    external_deps += [ "hilog:libhilog" ]
60  }
61  configs = [ ":qjs_inner_config" ]
62  public_configs = [ ":qjs_debug_config" ]
63}
64
65ohos_static_library("qjs") {
66  sources = qjs_sources
67  configs = [ ":qjs_inner_config" ]
68}
69
70ohos_executable("qjsc") {
71  sources = [
72    "cutils.c",
73    "libbf.c",
74    "libregexp.c",
75    "libunicode.c",
76    "qjsc.c",
77    "quickjs-libc.c",
78    "quickjs.c",
79  ]
80
81  configs = [ ":qjs_inner_config" ]
82
83  defines = [ "CONFIG_VERSION=" ]
84
85  if (current_toolchain == "//build/toolchain/mingw:mingw_x86_64") {
86    ldflags = [ "-static" ]
87
88    libs = [ "pthread" ]
89  }
90
91  subsystem_name = "ace"
92  part_name = "ace_engine_full"
93}
94