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