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. 11if (defined(ohos_lite)) { 12 import("//build/lite/config/component/lite_component.gni") 13} else { 14 import("//build/ohos.gni") 15} 16 17config("icu_config") { 18 include_dirs = [ "//third_party/icu/icu4c/source/common" ] 19 20 # IAR toolchain compilation does not support multithreaded libraries. 21 # The modification here will not affect the native function of icu. 22 # Build-system should pre-define UMUTEX_H to inactive umutex.h and active this mock header. 23 # The source of modification and the corresponding responsibilities can be found in foundation/graphic/ui/BUILD.gn. 24 if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") { 25 defines = [ 26 "U_PLATFORM_IMPLEMENTS_POSIX=0", 27 "UMUTEX_H", 28 "MUTEX_H", # ICC do not support mutex 29 ] 30 cflags_cc = [ 31 "--diag_suppress", 32 "Pe186", 33 ] 34 } 35} 36 37icu_source = [ 38 "//third_party/icu/icu4c/source/common/cmemory.cpp", 39 "//third_party/icu/icu4c/source/common/cstring.cpp", 40 "//third_party/icu/icu4c/source/common/ubidi.cpp", 41 "//third_party/icu/icu4c/source/common/ubidiln.cpp", 42 "//third_party/icu/icu4c/source/common/ubidiwrt.cpp", 43 "//third_party/icu/icu4c/source/common/ubidi_props.cpp", 44 "//third_party/icu/icu4c/source/common/uchar.cpp", 45 "//third_party/icu/icu4c/source/common/udataswp.cpp", 46 "//third_party/icu/icu4c/source/common/uinvchar.cpp", 47 "//third_party/icu/icu4c/source/common/ustring.cpp", 48 "//third_party/icu/icu4c/source/common/utf_impl.cpp", 49 "//third_party/icu/icu4c/source/common/utrie2.cpp", 50 "//third_party/icu/icu4c/source/common/ucptrie.cpp", 51] 52 53if (defined(ohos_lite)) { 54 lite_library("icu_font") { 55 sources = icu_source 56 public_configs = [ ":icu_config" ] 57 if (board_toolchain_type == "iccarm") { 58 target_type = "static_library" 59 } else { 60 target_type = "shared_library" 61 } 62 } 63} else { 64 ohos_static_library("icu_font") { 65 sources = icu_source 66 include_dirs = [ "src\base" ] 67 public_configs = [ ":icu_config" ] 68 } 69} 70