1# Copyright (c) 2023 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")
15import("//foundation/arkui/ace_engine/adapter/preview/build/component_test.gni")
16import("//foundation/arkui/ace_engine_lite/simulator.gni")
17import("../gn/config.gni")
18
19config("jsapp_config") {
20  cflags = [
21    "-std=c++17",
22    "-Wall",
23    "-Wno-deprecated-declarations",
24  ]
25  cflags_cc = cflags
26}
27
28config("jsapp_config_rich") {
29  visibility = [ ":*" ]
30
31  include_dirs = [ "rich" ]
32}
33
34ohos_source_set("jsapp_rich") {
35  defines = []
36  if (platform == "mingw_x86_64" && defined(enable_component_test) &&
37      enable_component_test) {
38    defines += [ "COMPONENT_TEST_ENABLED" ]
39  }
40  configs = [ ":jsapp_config" ]
41  sources = [
42    "JsApp.cpp",
43    "rich/JsAppImpl.cpp",
44  ]
45  include_dirs = [
46    ".",
47    "rich/",
48    "../mock/rich/",
49    "../cli/",
50    "../util/",
51    "../mock/",
52    "./external/",
53  ]
54  include_dirs += os_include_dirs
55  deps = [
56    "rich/external:ide_extension",
57    "//third_party/libwebsockets:websockets_static",
58  ]
59  external_deps = [
60    "ace_engine:libace_compatible",
61    "graphic_2d:librender_service_client",
62    "window_manager:previewer_window",
63  ]
64  if (platform != "linux_x64") {
65    external_deps += [ "ability_runtime:ability_simulator" ]
66  }
67  part_name = "previewer"
68  subsystem_name = "ide"
69}
70
71ohos_source_set("jsapp_lite") {
72  defines = [ "ENABLE_ICU" ]
73  if (build_lite_full) {
74    defines += [ "LITEWEARABLE_SUPPORTED=1" ]
75  }
76  configs = [ ":jsapp_config" ]
77  configs += [ "//third_party/freetype:freetype_config" ]
78  sources = [
79    "JsApp.cpp",
80    "lite/JsAppImpl.cpp",
81    "lite/TimerTaskHandler.cpp",
82  ]
83  include_dirs = [
84    ".",
85    "lite/",
86    "../mock/lite/",
87    "../util/",
88    "../mock/",
89    "../cli",
90    "//foundation/arkui/ui_lite/interfaces/innerkits/",
91    "//foundation/arkui/ui_lite/interfaces/kits/",
92    "//foundation/graphic/graphic_utils_lite/interfaces/innerkits/",
93    "//foundation/graphic/graphic_utils_lite/interfaces/kits/",
94    "//foundation/arkui/ui_lite/frameworks/",
95    "//foundation/arkui/ui_lite/frameworks/dock/",
96    "//foundation/arkui/ui_lite/interfaces/innerkits/dock/",
97  ]
98  if (build_lite_full) {
99    include_dirs += [
100      "//base/sensors/sensorjs_lite/sensor_lite/interfaces/js/builtin/sensor/include/",
101      "//base/location/interfaces/kits/geo_lite/js/builtin/include/",
102    ]
103  }
104  deps = [
105    "//foundation/arkui/ace_engine_lite/frameworks/targets/simulator:ace_lite",
106    "//third_party/libwebsockets:websockets_static",
107  ]
108  part_name = "previewer"
109  subsystem_name = "ide"
110}
111