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("//base/inputmethod/imf/inputmethod.gni")
15import("//build/ohos.gni")
16
17config("inputmethod_js_common_config") {
18  visibility = [ ":*" ]
19  include_dirs = [ "./" ]
20  ldflags = [ "-Wl,--exclude-libs=ALL" ]
21  cflags = [
22    "-fdata-sections",
23    "-ffunction-sections",
24    "-fvisibility=hidden",
25    "-Wno-c99-designator",
26  ]
27}
28
29config("inputmethod_js_common_public_config") {
30  visibility = [ "./*" ]
31  include_dirs = [
32    "./",
33    "${inputmethod_path}/frameworks/common",
34  ]
35}
36
37ohos_static_library("inputmethod_js_common") {
38  branch_protector_ret = "pac_ret"
39  sanitize = {
40    cfi = true
41    cfi_cross_dso = true
42    debug = false
43  }
44  sources = [
45    "event_checker.cpp",
46    "js_callback_handler.cpp",
47    "js_callback_object.cpp",
48    "js_util.cpp",
49  ]
50  configs = [ ":inputmethod_js_common_config" ]
51  public_configs = [ ":inputmethod_js_common_public_config" ]
52  deps = [ "${inputmethod_path}/common:inputmethod_common" ]
53  external_deps = [ "napi:ace_napi" ]
54  subsystem_name = "inputmethod"
55  part_name = "imf"
56}
57