1# Copyright 2021 Google Inc. 2# 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6import("../../gn/skia.gni") 7import("skunicode.gni") 8 9declare_args() { 10 skia_use_runtime_icu = false 11 skunicode_tests_enabled = true 12} 13 14if (skia_use_icu || skia_use_client_icu) { 15 config("public_config") { 16 include_dirs = [ "include" ] 17 defines = [ "SK_UNICODE_AVAILABLE" ] 18 if (skia_use_icu) { 19 defines += [ "SK_UNICODE_ICU_IMPLEMENTATION" ] 20 } else if (skia_use_client_icu) { 21 defines += [ "SK_UNICODE_CLIENT_IMPLEMENTATION" ] 22 } 23 if (is_component_build) { 24 defines += [ "SKUNICODE_DLL" ] 25 } 26 } 27 28 component("skunicode") { 29 check_includes = false 30 public_configs = [ ":public_config" ] 31 public = skia_unicode_public 32 if (!use_oh_skia) { 33 deps = [ "../..:skia" ] 34 } else { 35 include_dirs = [ "//third_party/skia" ] 36 deps = [] 37 } 38 defines = [ "SKUNICODE_IMPLEMENTATION=1" ] 39 sources = skia_unicode_sources 40 defines += [ "SK_UNICODE_AVAILABLE" ] 41 configs += [ "../../:skia_private" ] 42 43 if (skia_use_icu) { 44 sources += skia_unicode_icu_sources 45 defines += [ "SK_UNICODE_ICU_IMPLEMENTATION" ] 46 47 # only available for Android at the moment 48 if (skia_use_runtime_icu && (is_android || is_linux)) { 49 sources += skia_unicode_runtime_icu_sources 50 deps += [ "${skia_third_party_dir}/icu:headers" ] 51 } else { 52 sources += skia_unicode_builtin_icu_sources 53 deps += [ "${skia_third_party_dir}/icu" ] 54 if (is_arkui_x) { 55 deps -= [ "${skia_third_party_dir}/icu" ] 56 deps += [ "//third_party/icu/icu4c:static_icuuc" ] 57 include_dirs += [ "//third_party/icu/icu4c/source/common" ] 58 } 59 } 60 configs += [ "../../third_party/icu/config:no_cxx" ] 61 } else if (skia_use_client_icu) { 62 sources += skia_unicode_client_icu_sources 63 defines += [ "SK_UNICODE_CLIENT_IMPLEMENTATION" ] 64 deps += [ skia_icu_bidi_third_party_dir ] 65 } 66 } 67} else { 68 group("skunicode") { 69 } 70} 71