1# Copyright (c) 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# 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. 13import("//build/ohos.gni") 14 15############################################################################### 16config("utils_config") { 17 visibility = [ ":*" ] 18 include_dirs = [ 19 "include", 20 "//developtools/liblog", 21 ] 22 cflags = [] 23 if (current_os == "mingw") { 24 cflags += [ "-Wno-error=inconsistent-dllimport" ] 25 } 26} 27 28config("private_securec_config") { 29 cflags = [ "-Wno-implicit-fallthrough" ] 30} 31 32config("static_utils_config") { 33 visibility = [ ":*" ] 34 include_dirs = [ 35 "include", 36 "//developtools/liblog", 37 ] 38} 39 40config("utils_all_dependent_configs") { 41 include_dirs = [ "include" ] 42} 43 44sources_utils = [ 45 "src/string_ex.cpp", 46 "src/unicode_ex.cpp", 47 "src/directory_ex.cpp", 48 "src/datetime_ex.cpp", 49 "src/refbase.cpp", 50 "src/parcel.cpp", 51 "src/semaphore_ex.cpp", 52 "src/thread_pool.cpp", 53 "src/file_ex.cpp", 54 "src/observer.cpp", 55 "src/thread_ex.cpp", 56 "src/event_demultiplexer.cpp", 57 "src/event_handler.cpp", 58 "src/event_reactor.cpp", 59 "src/timer.cpp", 60 "src/timer_event_handler.cpp", 61 "src/ashmem.cpp", 62 "src/rwlock.cpp", 63] 64 65ohos_static_library("utilsbase") { 66 sources = sources_utils 67 all_dependent_configs = [ ":utils_all_dependent_configs" ] 68 if (current_os != "android" && current_os != "ios") { 69 defines = [ "CONFIG_HILOG" ] 70 } 71 external_deps = [ "hilog_native:libhilog_base" ] 72 public_deps = [ "//third_party/bounds_checking_function:libsec_static" ] 73 74 subsystem_name = "commonlibrary" 75 part_name = "c_utils" 76} 77 78ohos_static_library("utilsbase_rtti") { 79 visibility = [ "//foundation/multimedia/histreamer/engine/plugin/plugins/source/video_capture:std_video_capture" ] 80 sources = sources_utils 81 all_dependent_configs = [ ":utils_all_dependent_configs" ] 82 if (current_os != "android" && current_os != "ios") { 83 defines = [ "CONFIG_HILOG" ] 84 } 85 external_deps = [ "hilog_native:libhilog_base" ] 86 public_deps = [ "//third_party/bounds_checking_function:libsec_static" ] 87 remove_configs = [ "//build/config/compiler:no_rtti" ] 88 cflags = [ "-frtti" ] 89 subsystem_name = "commonlibrary" 90 part_name = "c_utils" 91} 92 93ohos_shared_library("utils") { 94 sources = sources_utils 95 all_dependent_configs = [ ":utils_all_dependent_configs" ] 96 if (current_os != "android" && current_os != "ios") { 97 defines = [ "CONFIG_HILOG" ] 98 } 99 external_deps = [ "hilog_native:libhilog_base" ] 100 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 101 102 subsystem_name = "commonlibrary" 103 part_name = "c_utils" 104 install_images = [ 105 "system", 106 "updater", 107 ] 108} 109############################################################################### 110