1# Copyright (c) 2021-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("../../../wallpaper.gni")
16
17config("ability_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "${wallpaper_path}/frameworks/native/include",
21    "${wallpaper_path}/frameworks/kits/extension/include",
22    "${ability_runtime_services_path}/common/include",
23  ]
24
25  cflags = []
26  if (target_cpu == "arm") {
27    cflags += [ "-DBINDER_IPC_32BIT" ]
28  }
29  defines = [
30    "APP_LOG_TAG = \"Ability\"",
31    "LOG_DOMAIN = 0xD002200",
32  ]
33}
34
35ohos_shared_library("wallpaperextensionability") {
36  cflags = [
37    "-fdata-sections",
38    "-ffunction-sections",
39    "-fvisibility=hidden",
40    "-Os",
41  ]
42
43  include_dirs = [
44    "${wallpaper_path}/frameworks/native/include",
45    "${wallpaper_path}/frameworks/kits/extension/include",
46  ]
47
48  sources = [
49    "${wallpaper_path}/frameworks/kits/extension/src/js_wallpaper_extension_ability.cpp",
50    "${wallpaper_path}/frameworks/kits/extension/src/js_wallpaper_extension_context.cpp",
51    "${wallpaper_path}/frameworks/kits/extension/src/wallpaper_extension_ability.cpp",
52    "${wallpaper_path}/frameworks/kits/extension/src/wallpaper_extension_context.cpp",
53  ]
54
55  configs = [ ":ability_config" ]
56
57  deps = [ "${wallpaper_path}/frameworks/native:wallpapermanager" ]
58
59  external_deps = [
60    "ability_base:want",
61    "ability_runtime:ability_context_native",
62    "ability_runtime:ability_manager",
63    "ability_runtime:ability_start_options",
64    "ability_runtime:app_context",
65    "ability_runtime:extensionkit_native",
66    "ability_runtime:napi_common",
67    "ability_runtime:runtime",
68    "c_utils:utils",
69    "eventhandler:libeventhandler",
70    "hilog:libhilog",
71    "hitrace:hitrace_meter",
72    "ipc:ipc_napi",
73    "ipc:ipc_single",
74    "napi:ace_napi",
75    "player_framework:media_client",
76    "window_manager:libwm",
77  ]
78
79  sanitize = {
80    cfi = true
81    cfi_cross_dso = true
82    debug = false
83    integer_overflow = true
84    boundary_sanitize = true
85    ubsan = true
86  }
87  branch_protector_ret = "pac_ret"
88  subsystem_name = "theme"
89  part_name = "wallpaper_mgr"
90}
91
92ohos_shared_library("wallpaper_extension_module") {
93  cflags = [
94    "-fdata-sections",
95    "-ffunction-sections",
96    "-fvisibility=hidden",
97    "-Os",
98  ]
99
100  sources = [ "${wallpaper_path}/frameworks/kits/extension/src/wallpaper_extension_module_loader.cpp" ]
101
102  configs = [ ":ability_config" ]
103
104  deps = [ ":wallpaperextensionability" ]
105
106  external_deps = [
107    "ability_runtime:abilitykit_native",
108    "ability_runtime:runtime",
109    "hilog:libhilog",
110    "napi:ace_napi",
111  ]
112  sanitize = {
113    cfi = true
114    cfi_cross_dso = true
115    debug = false
116    integer_overflow = true
117    boundary_sanitize = true
118    ubsan = true
119  }
120  branch_protector_ret = "pac_ret"
121  relative_install_dir = "extensionability/"
122  subsystem_name = "theme"
123  part_name = "wallpaper_mgr"
124}
125