1# Copyright (c) 2020-2021 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# http://www.apache.org/licenses/LICENSE-2.0 6# Unless required by applicable law or agreed to in writing, software 7# distributed under the License is distributed on an "AS IS" BASIS, 8# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9# See the License for the specific language governing permissions and 10# limitations under the License. 11 12import("//build/lite/config/component/lite_component.gni") 13import("//build/lite/config/subsystem/graphic/config.gni") 14import("//build/lite/ndk/ndk.gni") 15 16defines = [] 17 18declare_args() { 19 enable_ohos_graphic_utils_product_config = false 20} 21 22if (enable_ohos_graphic_utils_product_config) { 23 defines += [ "ENABLE_OHOS_GRAPHIC_UTILS_PRODUCT_CONFIG=1" ] 24} 25 26lite_component("lite_graphic_utils") { 27 features = [ ":graphic_utils" ] 28 public_deps = features 29} 30 31ndk_lib("lite_graphic_utils_ndk") { 32 lib_extension = ".so" 33 deps = [ ":graphic_utils" ] 34 head_files = [ "interfaces/kits" ] 35} 36 37lite_library("graphic_utils") { 38 if (ohos_kernel_type == "liteos_m") { 39 target_type = "static_library" 40 } else { 41 target_type = "shared_library" 42 } 43 44 if (enable_graphic_dualcore == true) { 45 defines += [ "HAL_CPU_NUM = 2" ] 46 } 47 48 sources = [ 49 "frameworks/color.cpp", 50 "frameworks/geometry2d.cpp", 51 "frameworks/graphic_math.cpp", 52 "frameworks/graphic_performance.cpp", 53 "frameworks/graphic_timer.cpp", 54 "frameworks/hal_cpu.cpp", 55 "frameworks/hal_tick.cpp", 56 "frameworks/mem_api.cpp", 57 "frameworks/pixel_format_utils.cpp", 58 "frameworks/queue.c", 59 "frameworks/style.cpp", 60 "frameworks/transform.cpp", 61 "frameworks/version.cpp", 62 ] 63 include_dirs = [ "frameworks" ] 64 public_configs = [ ":graphic_utils_public_config" ] 65 if (ohos_kernel_type == "liteos_m") { 66 deps = [ "//third_party/bounds_checking_function:libsec_static" ] 67 public_deps = 68 [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] 69 } else { 70 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 71 public_deps = 72 [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] 73 } 74 cflags = [ "-Wall" ] 75 cflags_cc = cflags 76} 77 78config("graphic_utils_public_config") { 79 include_dirs = [ 80 "interfaces/innerkits", 81 "interfaces/kits", 82 "$product_path/graphic_config", 83 ] 84} 85 86if (ohos_kernel_type != "liteos_m") { 87 lite_component("lite_graphic_hals") { 88 features = [ ":graphic_hals" ] 89 public_deps = features 90 } 91 92 ndk_lib("lite_graphic_hals_ndk") { 93 lib_extension = ".so" 94 deps = [ ":graphic_hals" ] 95 head_files = [] 96 } 97 98 shared_library("graphic_hals") { 99 sources = [ 100 "frameworks/hals/gfx_engines.cpp", 101 "frameworks/hals/hi_fbdev.cpp", 102 ] 103 include_dirs = [ "//foundation/graphic/wms/interfaces/innerkits" ] 104 deps = [ 105 ":lite_graphic_utils", 106 "//drivers/peripheral/display/hal:hdi_display", 107 ] 108 public_configs = [ ":graphic_hals_public_config" ] 109 ldflags = [ 110 "-ldisplay_gfx", 111 "-ldisplay_gralloc", 112 "-ldisplay_layer", 113 ] 114 } 115} 116 117config("graphic_hals_public_config") { 118 include_dirs = [ 119 "interfaces/innerkits", 120 "//drivers/peripheral/base", 121 "//drivers/peripheral/display/interfaces/include", 122 "$product_path/graphic_config", 123 ] 124} 125