• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("//build/ohos.gni")
15import("third_libinput.gni")
16
17defines = third_input_default_defines
18gen_dst_dir = root_out_dir + "/diff_libinput_mmi"
19
20config("libinput-third_config") {
21  visibility = [ ":*" ]
22
23  include_dirs = [
24    "$gen_dst_dir/src",
25    "$gen_dst_dir/include",
26    "$gen_dst_dir/hm_src",
27  ]
28
29  cflags = [
30    "-Wno-unused-parameter",
31    "-Wno-implicit-int",
32    "-Wno-return-type",
33    "-Wno-unused-function",
34    "-Wno-string-conversion",
35    "-DHAVE_LIBINPUT_LOG_CONSOLE_ENABLE",
36    "-DHAVE_LIBINPUT_LOG_ENABLE",
37  ]
38}
39
40config("libinput-third_public_config") {
41  include_dirs = [
42    "$gen_dst_dir/export_include",
43    "$gen_dst_dir/include",
44    "$gen_dst_dir/src",
45  ]
46
47  cflags = []
48}
49
50ohos_source_set("patch_gen_libinput-third-mmi") {
51  part_name = "libinput"
52  subsystem_name = "thirdparty"
53  sources = [
54    root_out_dir + "/diff_libinput_mmi/src/evdev-debounce.c",
55    root_out_dir + "/diff_libinput_mmi/src/evdev-fallback.c",
56    root_out_dir + "/diff_libinput_mmi/src/evdev-joystick.c",
57    root_out_dir + "/diff_libinput_mmi/src/evdev-privacy-switch.c",
58    root_out_dir + "/diff_libinput_mmi/src/evdev-middle-button.c",
59    root_out_dir + "/diff_libinput_mmi/src/evdev-mt-touchpad-buttons.c",
60    root_out_dir + "/diff_libinput_mmi/src/evdev-mt-touchpad-edge-scroll.c",
61    root_out_dir + "/diff_libinput_mmi/src/evdev-mt-touchpad-gestures.c",
62    root_out_dir + "/diff_libinput_mmi/src/evdev-mt-touchpad-tap.c",
63    root_out_dir + "/diff_libinput_mmi/src/evdev-mt-touchpad-thumb.c",
64    root_out_dir + "/diff_libinput_mmi/src/evdev-mt-touchpad.c",
65    root_out_dir + "/diff_libinput_mmi/src/evdev-tablet-pad-leds.c",
66    root_out_dir + "/diff_libinput_mmi/src/evdev-tablet-pad.c",
67    root_out_dir + "/diff_libinput_mmi/src/evdev-tablet.c",
68    root_out_dir + "/diff_libinput_mmi/src/evdev-totem.c",
69    root_out_dir + "/diff_libinput_mmi/src/evdev-wheel.c",
70    root_out_dir + "/diff_libinput_mmi/src/evdev.c",
71    root_out_dir + "/diff_libinput_mmi/src/filter-custom.c",
72    root_out_dir + "/diff_libinput_mmi/src/filter-flat.c",
73    root_out_dir + "/diff_libinput_mmi/src/filter-low-dpi.c",
74    root_out_dir + "/diff_libinput_mmi/src/filter-mouse.c",
75    root_out_dir + "/diff_libinput_mmi/src/filter-tablet.c",
76    root_out_dir + "/diff_libinput_mmi/src/filter-touchpad-flat.c",
77    root_out_dir + "/diff_libinput_mmi/src/filter-touchpad-x230.c",
78    root_out_dir + "/diff_libinput_mmi/src/filter-touchpad.c",
79    root_out_dir + "/diff_libinput_mmi/src/filter-trackpoint-flat.c",
80    root_out_dir + "/diff_libinput_mmi/src/filter-trackpoint.c",
81    root_out_dir + "/diff_libinput_mmi/src/filter.c",
82    root_out_dir + "/diff_libinput_mmi/src/libinput-util.c",
83    root_out_dir + "/diff_libinput_mmi/src/libinput.c",
84    root_out_dir + "/diff_libinput_mmi/src/path-seat.c",
85    root_out_dir + "/diff_libinput_mmi/src/quirks.c",
86    root_out_dir + "/diff_libinput_mmi/src/timer.c",
87    root_out_dir + "/diff_libinput_mmi/src/util-list.c",
88    root_out_dir + "/diff_libinput_mmi/src/util-prop-parsers.c",
89    root_out_dir + "/diff_libinput_mmi/src/util-ratelimit.c",
90    root_out_dir + "/diff_libinput_mmi/src/util-strings.c",
91  ]
92  branch_protector_ret = "pac_ret"
93  sanitize = {
94    cfi = true
95    cfi_cross_dso = true
96    debug = false
97  }
98  configs = [ ":libinput-third_config" ]
99
100  public_configs = [ ":libinput-third_public_config" ]
101
102  deps = [ "patch:apply_patch" ]
103
104  external_deps = [ "input:mmi_libudev" ]
105
106  public_external_deps = [
107    "libevdev:libevdev",
108    "mtdev:libmtdev-third-mmi",
109  ]
110}
111
112ohos_shared_library("libinput-third-mmi") {
113  sources = []
114  branch_protector_ret = "pac_ret"
115  sanitize = {
116    cfi = true
117    cfi_cross_dso = true
118    debug = false
119  }
120  configs = [ ":libinput-third_config" ]
121
122  public_configs = [ ":libinput-third_public_config" ]
123
124  deps = [ ":patch_gen_libinput-third-mmi" ]
125
126  public_external_deps = [
127    "input:mmi_libudev",
128    "libevdev:libevdev",
129    "mtdev:libmtdev-third-mmi",
130  ]
131
132  external_deps = [ "hilog:libhilog" ]
133  license_file = "${third_libinput_root_path}/COPYING"
134  part_name = "libinput"
135  subsystem_name = "thirdparty"
136}
137
138ohos_source_set("patch_gen_libinput-debug") {
139  part_name = "input"
140  subsystem_name = "multimodalinput"
141  sources = [
142    "$gen_dst_dir/tools/libinput-debug-events.c",
143    "$gen_dst_dir/tools/shared.c",
144    "$gen_dst_dir/tools/shared.h",
145  ]
146  branch_protector_ret = "pac_ret"
147  sanitize = {
148    cfi = true
149    cfi_cross_dso = true
150    debug = false
151  }
152  configs = [ ":libinput-third_config" ]
153
154  public_configs = [ ":libinput-third_public_config" ]
155
156  deps = [ "//third_party/libinput/patch:apply_patch" ]
157
158  public_external_deps = [
159    "input:mmi_libudev",
160    "libevdev:libevdev",
161    "mtdev:libmtdev-third-mmi",
162  ]
163}
164
165ohos_executable("libinput-debug-mmi") {
166  install_enable = true
167
168  sources = []
169  branch_protector_ret = "pac_ret"
170  sanitize = {
171    cfi = true
172    cfi_cross_dso = true
173    debug = false
174  }
175  configs = [ ":libinput-third_config" ]
176
177  public_configs = [ ":libinput-third_public_config" ]
178
179  deps = [
180    ":libinput-third-mmi",
181    ":patch_gen_libinput-debug",
182  ]
183
184  public_external_deps = [
185    "input:mmi_libudev",
186    "libevdev:libevdev",
187    "mtdev:libmtdev-third-mmi",
188  ]
189
190  part_name = "input"
191  subsystem_name = "multimodalinput"
192}
193
194ohos_source_set("patch_gen_libinput-list") {
195  part_name = "input"
196  subsystem_name = "multimodalinput"
197  sources = [
198    "$gen_dst_dir/tools/libinput-list-devices.c",
199    "$gen_dst_dir/tools/shared.c",
200    "$gen_dst_dir/tools/shared.h",
201  ]
202  branch_protector_ret = "pac_ret"
203  sanitize = {
204    cfi = true
205    cfi_cross_dso = true
206    debug = false
207  }
208  configs = [ ":libinput-third_config" ]
209
210  public_configs = [ ":libinput-third_public_config" ]
211
212  deps = [ "//third_party/libinput/patch:apply_patch" ]
213
214  public_external_deps = [
215    "input:mmi_libudev",
216    "libevdev:libevdev",
217    "mtdev:libmtdev-third-mmi",
218  ]
219}
220
221ohos_executable("libinput-list-mmi") {
222  install_enable = true
223
224  sources = []
225  branch_protector_ret = "pac_ret"
226  sanitize = {
227    cfi = true
228    cfi_cross_dso = true
229    debug = false
230  }
231  configs = [ ":libinput-third_config" ]
232
233  public_configs = [ ":libinput-third_public_config" ]
234
235  deps = [
236    ":libinput-third-mmi",
237    ":patch_gen_libinput-list",
238  ]
239
240  public_external_deps = [
241    "input:mmi_libudev",
242    "libevdev:libevdev",
243    "mtdev:libmtdev-third-mmi",
244  ]
245
246  part_name = "input"
247  subsystem_name = "multimodalinput"
248}
249
250ohos_source_set("patch_gen_libinput-tablet") {
251  part_name = "input"
252  subsystem_name = "multimodalinput"
253  sources = [
254    "$gen_dst_dir/tools/libinput-debug-tablet.c",
255    "$gen_dst_dir/tools/shared.c",
256    "$gen_dst_dir/tools/shared.h",
257  ]
258  branch_protector_ret = "pac_ret"
259  sanitize = {
260    cfi = true
261    cfi_cross_dso = true
262    debug = false
263  }
264  configs = [ ":libinput-third_config" ]
265
266  public_configs = [ ":libinput-third_public_config" ]
267
268  deps = [ "//third_party/libinput/patch:apply_patch" ]
269
270  public_external_deps = [
271    "input:mmi_libudev",
272    "libevdev:libevdev",
273    "mtdev:libmtdev-third-mmi",
274  ]
275}
276
277ohos_executable("libinput-tablet-mmi") {
278  install_enable = true
279
280  sources = []
281  branch_protector_ret = "pac_ret"
282  sanitize = {
283    cfi = true
284    cfi_cross_dso = true
285    debug = false
286  }
287  configs = [ ":libinput-third_config" ]
288
289  public_configs = [ ":libinput-third_public_config" ]
290
291  deps = [
292    ":libinput-third-mmi",
293    ":patch_gen_libinput-tablet",
294  ]
295
296  public_external_deps = [
297    "input:mmi_libudev",
298    "libevdev:libevdev",
299    "mtdev:libmtdev-third-mmi",
300  ]
301
302  part_name = "input"
303  subsystem_name = "multimodalinput"
304}
305
306ohos_source_set("patch_gen_libinput-record") {
307  part_name = "input"
308  subsystem_name = "multimodalinput"
309  sources = [
310    "$gen_dst_dir/hm_src/hm_missing.c",
311    "$gen_dst_dir/tools/libinput-record.c",
312    "$gen_dst_dir/tools/shared.c",
313    "$gen_dst_dir/tools/shared.h",
314  ]
315  branch_protector_ret = "pac_ret"
316  sanitize = {
317    cfi = true
318    cfi_cross_dso = true
319    debug = false
320  }
321  configs = [ ":libinput-third_config" ]
322
323  public_configs = [ ":libinput-third_public_config" ]
324
325  deps = [ "//third_party/libinput/patch:apply_patch" ]
326
327  public_external_deps = [
328    "input:mmi_libudev",
329    "libevdev:libevdev",
330    "mtdev:libmtdev-third-mmi",
331  ]
332}
333
334ohos_executable("libinput-record-mmi") {
335  install_enable = true
336
337  sources = []
338  branch_protector_ret = "pac_ret"
339  sanitize = {
340    cfi = true
341    cfi_cross_dso = true
342    debug = false
343  }
344  configs = [ ":libinput-third_config" ]
345
346  public_configs = [ ":libinput-third_public_config" ]
347
348  deps = [
349    ":libinput-third-mmi",
350    ":patch_gen_libinput-record",
351  ]
352
353  public_external_deps = [
354    "input:mmi_libudev",
355    "libevdev:libevdev",
356    "mtdev:libmtdev-third-mmi",
357  ]
358
359  part_name = "input"
360  subsystem_name = "multimodalinput"
361}
362
363ohos_source_set("patch_gen_libinput-analyze") {
364  part_name = "input"
365  subsystem_name = "multimodalinput"
366  sources = [
367    "$gen_dst_dir/tools/libinput-analyze.c",
368    "$gen_dst_dir/tools/shared.c",
369    "$gen_dst_dir/tools/shared.h",
370  ]
371  branch_protector_ret = "pac_ret"
372  sanitize = {
373    cfi = true
374    cfi_cross_dso = true
375    debug = false
376  }
377  configs = [ ":libinput-third_config" ]
378
379  public_configs = [ ":libinput-third_public_config" ]
380
381  deps = [ "//third_party/libinput/patch:apply_patch" ]
382
383  public_external_deps = [
384    "input:mmi_libudev",
385    "libevdev:libevdev",
386    "mtdev:libmtdev-third-mmi",
387  ]
388}
389
390ohos_executable("libinput-analyze-mmi") {
391  install_enable = true
392
393  sources = []
394  branch_protector_ret = "pac_ret"
395  sanitize = {
396    cfi = true
397    cfi_cross_dso = true
398    debug = false
399  }
400  configs = [ ":libinput-third_config" ]
401
402  public_configs = [ ":libinput-third_public_config" ]
403
404  deps = [
405    ":libinput-third-mmi",
406    ":patch_gen_libinput-analyze",
407  ]
408
409  public_external_deps = [
410    "input:mmi_libudev",
411    "libevdev:libevdev",
412    "mtdev:libmtdev-third-mmi",
413  ]
414
415  part_name = "input"
416  subsystem_name = "multimodalinput"
417}
418
419ohos_source_set("patch_gen_libinput-measure") {
420  part_name = "input"
421  subsystem_name = "multimodalinput"
422  sources = [
423    "$gen_dst_dir/tools/libinput-measure.c",
424    "$gen_dst_dir/tools/shared.c",
425    "$gen_dst_dir/tools/shared.h",
426  ]
427  branch_protector_ret = "pac_ret"
428  sanitize = {
429    cfi = true
430    cfi_cross_dso = true
431    debug = false
432  }
433  configs = [ ":libinput-third_config" ]
434
435  public_configs = [ ":libinput-third_public_config" ]
436
437  deps = [ "//third_party/libinput/patch:apply_patch" ]
438
439  public_external_deps = [
440    "input:mmi_libudev",
441    "libevdev:libevdev",
442    "mtdev:libmtdev-third-mmi",
443  ]
444}
445
446ohos_executable("libinput-measure-mmi") {
447  install_enable = true
448
449  sources = []
450  branch_protector_ret = "pac_ret"
451  sanitize = {
452    cfi = true
453    cfi_cross_dso = true
454    debug = false
455  }
456  configs = [ ":libinput-third_config" ]
457
458  public_configs = [ ":libinput-third_public_config" ]
459
460  deps = [
461    ":libinput-third-mmi",
462    ":patch_gen_libinput-measure",
463  ]
464
465  public_external_deps = [
466    "input:mmi_libudev",
467    "libevdev:libevdev",
468    "mtdev:libmtdev-third-mmi",
469  ]
470
471  part_name = "input"
472  subsystem_name = "multimodalinput"
473}
474
475ohos_source_set("patch_gen_libinput-quirks") {
476  part_name = "input"
477  subsystem_name = "multimodalinput"
478  sources = [
479    "$gen_dst_dir/tools/libinput-quirks.c",
480    "$gen_dst_dir/tools/shared.c",
481    "$gen_dst_dir/tools/shared.h",
482  ]
483  branch_protector_ret = "pac_ret"
484  sanitize = {
485    cfi = true
486    cfi_cross_dso = true
487    debug = false
488  }
489  configs = [ ":libinput-third_config" ]
490
491  public_configs = [ ":libinput-third_public_config" ]
492
493  deps = [ "//third_party/libinput/patch:apply_patch" ]
494
495  public_external_deps = [
496    "input:mmi_libudev",
497    "libevdev:libevdev",
498    "mtdev:libmtdev-third-mmi",
499  ]
500}
501
502ohos_executable("libinput-quirks-mmi") {
503  install_enable = true
504
505  sources = []
506  branch_protector_ret = "pac_ret"
507  sanitize = {
508    cfi = true
509    cfi_cross_dso = true
510    debug = false
511  }
512  configs = [ ":libinput-third_config" ]
513
514  public_configs = [ ":libinput-third_public_config" ]
515
516  deps = [
517    ":libinput-third-mmi",
518    ":patch_gen_libinput-quirks",
519  ]
520
521  public_external_deps = [
522    "input:mmi_libudev",
523    "libevdev:libevdev",
524    "mtdev:libmtdev-third-mmi",
525  ]
526
527  part_name = "input"
528  subsystem_name = "multimodalinput"
529}
530