1# Copyright (c) 2021-2024 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
16gen_dst_dir = root_out_dir + "/diff_libmtdev_mmi"
17
18config("libmtdev-third_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "$gen_dst_dir/src",
23    "$gen_dst_dir/include",
24  ]
25
26  cflags = [
27    "-Wno-unused-parameter",
28    "-Wno-sign-compare",
29    "-DDISABLE_FILTER",
30  ]
31}
32
33config("libmtdev-third_public_config") {
34  include_dirs = [ "$gen_dst_dir/include" ]
35
36  cflags = []
37}
38
39ohos_source_set("patch_gen_libmtdev-third-mmi") {
40  part_name = "input"
41  subsystem_name = "multimodalinput"
42  sources = [
43    root_out_dir + "/diff_libmtdev_mmi/src/caps.c",
44    root_out_dir + "/diff_libmtdev_mmi/src/core.c",
45    root_out_dir + "/diff_libmtdev_mmi/src/iobuf.c",
46    root_out_dir + "/diff_libmtdev_mmi/src/match.c",
47    root_out_dir + "/diff_libmtdev_mmi/src/match_four.c",
48  ]
49  branch_protector_ret = "pac_ret"
50  sanitize = {
51    cfi = true
52    cfi_cross_dso = true
53    debug = false
54  }
55  configs = [ ":libmtdev-third_config" ]
56
57  public_configs = [ ":libmtdev-third_public_config" ]
58
59  deps = [ "//third_party/mtdev/patch:apply_patch" ]
60
61  public_deps = []
62}
63
64ohos_shared_library("libmtdev-third-mmi") {
65  sources = []
66  branch_protector_ret = "pac_ret"
67  sanitize = {
68    cfi = true
69    cfi_cross_dso = true
70    debug = false
71  }
72  configs = [ ":libmtdev-third_config" ]
73
74  public_configs = [ ":libmtdev-third_public_config" ]
75
76  deps = [ ":patch_gen_libmtdev-third-mmi" ]
77
78  public_deps = []
79  license_file = "//third_party/mtdev/COPYING"
80  part_name = "input"
81  subsystem_name = "multimodalinput"
82}
83