# Copyright (c) 2020-2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") } else { import("//build/ohos.gni") } config("icu_config") { include_dirs = [ "//third_party/icu/icu4c/source/common" ] # IAR toolchain compilation does not support multithreaded libraries. # The modification here will not affect the native function of icu. # Build-system should pre-define UMUTEX_H to inactive umutex.h and active this mock header. # The source of modification and the corresponding responsibilities can be found in foundation/arkui/ui_lite/BUILD.gn. if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") { defines = [ "U_PLATFORM_IMPLEMENTS_POSIX=0", "UMUTEX_H", "MUTEX_H", # ICC do not support mutex ] cflags_cc = [ "--diag_suppress", "Pe186", ] } } icu_source = [ "//third_party/icu/icu4c/source/common/cmemory.cpp", "//third_party/icu/icu4c/source/common/cstring.cpp", "//third_party/icu/icu4c/source/common/ubidi.cpp", "//third_party/icu/icu4c/source/common/ubidiln.cpp", "//third_party/icu/icu4c/source/common/ubidiwrt.cpp", "//third_party/icu/icu4c/source/common/ubidi_props.cpp", "//third_party/icu/icu4c/source/common/uchar.cpp", "//third_party/icu/icu4c/source/common/udataswp.cpp", "//third_party/icu/icu4c/source/common/uinvchar.cpp", "//third_party/icu/icu4c/source/common/ustring.cpp", "//third_party/icu/icu4c/source/common/utf_impl.cpp", "//third_party/icu/icu4c/source/common/utrie2.cpp", "//third_party/icu/icu4c/source/common/ucptrie.cpp", ] if (defined(ohos_lite)) { lite_library("icu_font") { sources = icu_source public_configs = [ ":icu_config" ] if (board_toolchain_type == "iccarm") { target_type = "static_library" } else { target_type = "shared_library" } } } else { ohos_static_library("icu_font") { sources = icu_source include_dirs = [ "src\base" ] public_configs = [ ":icu_config" ] } }