• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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("//base/print/print_fwk/print.gni")
15import("//build/ohos.gni")
16
17cflags_cc = []
18
19_sources = [
20  "src/hisys_event_util.cpp",
21  "src/operation_queue.cpp",
22  "src/print_bms_death_recipient.cpp",
23  "src/print_bms_helper.cpp",
24  "src/print_callback_proxy.cpp",
25  "src/print_event_subscriber.cpp",
26  "src/print_extension_callback_proxy.cpp",
27  "src/print_security_guard_info.cpp",
28  "src/print_security_guard_manager.cpp",
29  "src/print_service_ability.cpp",
30  "src/print_service_converter.cpp",
31  "src/print_service_helper.cpp",
32  "src/print_service_stub.cpp",
33  "src/print_system_data.cpp",
34  "src/print_user_data.cpp",
35  "src/thread_sync_wait.cpp",
36  "src/vendor_bsuni_driver.cpp",
37  "src/vendor_driver_base.cpp",
38  "src/vendor_driver_group.cpp",
39  "src/vendor_helper.cpp",
40  "src/vendor_ipp_everywhere.cpp",
41  "src/vendor_manager.cpp",
42  "src/vendor_ppd_driver.cpp",
43  "src/vendor_wlan_group.cpp",
44]
45
46_deps = [ "${print_path}/frameworks/models/print_models:print_models" ]
47
48_external_deps = [
49  "ability_base:base",
50  "ability_base:want",
51  "ability_base:zuri",
52  "ability_runtime:ability_connect_callback_stub",
53  "ability_runtime:ability_manager",
54  "ability_runtime:abilitykit_native",
55  "ability_runtime:app_manager",
56  "access_token:libaccesstoken_sdk",
57  "bundle_framework:appexecfwk_base",
58  "bundle_framework:appexecfwk_core",
59  "c_utils:utils",
60  "common_event_service:cesfwk_innerkits",
61  "drivers_interface_usb:libusb_proxy_1.0",
62  "eventhandler:libeventhandler",
63  "hilog:libhilog",
64  "hisysevent:libhisysevent",
65  "init:libbegetutil",
66  "ipc:ipc_core",
67  "jsoncpp:jsoncpp",
68  "napi:ace_napi",
69  "openssl:libssl_shared",
70  "os_account:os_account_innerkits",
71  "safwk:system_ability_fwk",
72  "samgr:samgr_proxy",
73  "usb_manager:usbsrv_client",
74  "wifi:wifi_sdk",
75]
76
77_public_configs = [ ":print_service_config" ]
78
79_include_dirs = [
80  "${print_path}/frameworks/innerkitsimpl/print_impl/include",
81  "${print_path}/frameworks/ohprint/include",
82  "${print_utils_path}/include",
83]
84
85_branch_protector_ret = "pac_ret"
86_sanitize = {
87  cfi = true
88  cfi_cross_dso = true
89  boundary_sanitize = true
90  debug = false
91  integer_overflow = true
92  ubsan = true
93}
94
95config("print_service_config") {
96  visibility = [ ":*" ]
97  include_dirs = [
98    "include",
99    "${print_path}/frameworks/models/print_models/include",
100  ]
101  cflags_cc += [
102    "-fno-exceptions",
103    "-fdata-sections",
104    "-ffunction-sections",
105    "-fno-asynchronous-unwind-tables",
106    "-fno-unwind-tables",
107    "-flto",
108    "-Os",
109  ]
110}
111
112ohos_shared_library("print_service") {
113  sources = _sources
114  branch_protector_ret = _branch_protector_ret
115  sanitize = _sanitize
116  public_configs = _public_configs
117  include_dirs = _include_dirs
118  deps = _deps
119  external_deps = _external_deps
120
121  cflags_cc += [ "-fvisibility=hidden" ]
122  if (cups_enable) {
123    sources += [
124      "src/print_cups_attribute.cpp",
125      "src/print_cups_ppd.cpp",
126      "src/print_cups_client.cpp",
127      "src/print_cups_wrapper.cpp",
128    ]
129    cflags_cc += [ "-DCUPS_ENABLE" ]
130    external_deps += [
131      "cJSON:cjson",
132      "cups:cups",
133      "cups-filters:cupsfilters",
134    ]
135  }
136
137  if (security_guard_enabled) {
138    external_deps += [
139      "security_guard:libsg_collect_sdk",
140      "time_service:time_client",
141    ]
142    cflags_cc += [ "-DSECURITY_GUARDE_ENABLE" ]
143  }
144
145  if (print_fwk_feature_enterprise) {
146    cflags_cc += [ "-DENTERPRISE_ENABLE" ]
147  }
148
149  if (build_variant == "user") {
150    cflags_cc += [ "-DIS_RELEASE_VERSION" ]
151  }
152
153  subsystem_name = "print"
154  part_name = "print_fwk"
155}
156
157ohos_static_library("print_service_test") {
158  sources = _sources
159  branch_protector_ret = _branch_protector_ret
160  sanitize = _sanitize
161  public_configs = _public_configs
162  include_dirs = _include_dirs
163  deps = _deps
164  external_deps = _external_deps
165
166  if (cups_enable) {
167    sources += [
168      "src/print_cups_attribute.cpp",
169      "src/print_cups_ppd.cpp",
170      "src/print_cups_client.cpp",
171      "src/print_cups_wrapper.cpp",
172    ]
173    cflags_cc += [ "-DCUPS_ENABLE" ]
174    external_deps += [
175      "cJSON:cjson",
176      "cups:cups",
177      "cups-filters:cupsfilters",
178    ]
179  }
180
181  if (security_guard_enabled) {
182    external_deps += [
183      "security_guard:libsg_collect_sdk",
184      "time_service:time_client",
185    ]
186    cflags_cc += [ "-DSECURITY_GUARDE_ENABLE" ]
187  }
188
189  if (build_variant == "user") {
190    cflags_cc += [ "-DIS_RELEASE_VERSION" ]
191  }
192
193  subsystem_name = "print"
194  part_name = "print_fwk"
195}
196