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