1# Copyright (c) 2023 Huawei Device Co., Ltd.. All rights reserved. 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("//foundation/graphic/graphic_2d/graphic_config.gni") 16 17config("texgine_drawing_public_config") { 18 include_dirs = [ 19 "./src", 20 "../export", 21 ] 22 cflags = [ 23 "-Wall", 24 "-Werror", 25 "-g3", 26 "-std=c++17", 27 ] 28} 29 30if (defined(use_rosen_drawing) && use_rosen_drawing) { 31 ohos_source_set("libtexgine_drawing") { 32 public_configs = [ ":texgine_drawing_public_config" ] 33 include_dirs = [ 34 "$graphic_2d_root/rosen/modules/render_service_base/include", 35 "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter", 36 "$graphic_2d_root/rosen/modules/2d_graphics/include", 37 "$graphic_2d_root/rosen/modules/2d_graphics/src", 38 ] 39 40 platform = current_os 41 if (platform == "mingw") { 42 platform = "windows" 43 } 44 45 if (is_arkui_x) { 46 public_deps = [ "//third_party/skia:skia_$platform" ] 47 } else { 48 public_external_deps = [ "skia:skia_canvaskit" ] 49 } 50 deps = [] 51 if (is_arkui_x) { 52 deps += [ "//third_party/bounds_checking_function:libsec_static" ] 53 } 54 55 if (defined(use_rosen_drawing) && use_rosen_drawing) { 56 defines = [ "USE_ROSEN_DRAWING" ] 57 if (rs_enable_gpu) { 58 defines += [ "RS_ENABLE_GPU" ] 59 } 60 } 61 62 part_name = "graphic_2d" 63 subsystem_name = "graphic" 64 } 65} else { 66 ohos_shared_library("libtexgine_drawing") { 67 public_configs = [ ":texgine_drawing_public_config" ] 68 69 platform = current_os 70 if (platform == "mingw") { 71 platform = "windows" 72 } 73 74 public_external_deps = [ "skia:skia_canvaskit" ] 75 76 deps = [] 77 78 if (is_cross_platform) { 79 public_deps += [ "//foundation/appframework/icu_data:static_icudata" ] 80 } 81 82 innerapi_tags = [ "platformsdk" ] 83 part_name = "graphic_2d" 84 subsystem_name = "graphic" 85 } 86} 87