From df63fb7805ba8cfca6b47812f13276d069cfdb4b Mon Sep 17 00:00:00 2001 From: bilaizi Date: Thu, 3 Aug 2023 08:17:06 +0800 Subject: [PATCH] Add utils rtti support Signed-off-by: bilaizi --- base/BUILD.gn | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ bundle.json | 33 ++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/base/BUILD.gn b/base/BUILD.gn index 1e0ea91..bc745ab 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -186,6 +186,62 @@ ohos_shared_library("utils") { } } +ohos_shared_library("utils_rtti") { + remove_configs = [ "//build/config/compiler:no_rtti" ] + cflags = [ "-frtti" ] + innerapi_tags = [ + "chipsetsdk", + "platformsdk", + ] + if (current_os == "ios") { + sources = sources_utils_ios + configs = [ ":utils_coverage_config" ] + all_dependent_configs = [ ":utils_config" ] + public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] + defines = [ "IOS_PLATFORM" ] + + subsystem_name = "commonlibrary" + part_name = "c_utils" + } else { + sources = sources_utils + configs = [ ":utils_coverage_config" ] + + if (!build_cross_platform_version) { + if (c_utils_feature_intsan) { + sanitize = { + integer_overflow = true + } + } + } + + if (c_utils_debug_refbase) { + configs += [ ":debug_refbase" ] + if (c_utils_track_all) { + configs += [ ":track_all" ] + } + if (c_utils_print_track_at_once) { + configs += [ ":print_track_at_once" ] + } + } + all_dependent_configs = [ ":utils_config" ] + if (current_os != "android" && current_os != "ios") { + defines = [ "CONFIG_HILOG" ] + } + if (c_utils_debug_log_enabled) { + configs += [ ":debug_log_enabled" ] + } + external_deps = [ "hilog:libhilog_base" ] + public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] + + subsystem_name = "commonlibrary" + part_name = "c_utils" + install_images = [ + "system", + "updater", + ] + } +} + ########## modules for `c_utils` in rust ########## # rust compiler is not supportted on mac if (host_os == "linux" && !is_asan && !build_cross_platform_version) { diff --git a/bundle.json b/bundle.json index 4366b17..dcf8334 100644 --- a/bundle.json +++ b/bundle.json @@ -68,6 +68,39 @@ "header_base": "//commonlibrary/c_utils/base/include" } }, + { + "name": "//commonlibrary/c_utils/base:utils_rtti", + "header": { + "header_files": [ + "ashmem.h", + "common_errors.h", + "common_timer_errors.h", + "datetime_ex.h", + "directory_ex.h", + "errors.h", + "file_ex.h", + "flat_obj.h", + "nocopyable.h", + "observer.h", + "parcel.h", + "pubdef.h", + "refbase.h", + "rwlock.h", + "safe_block_queue.h", + "safe_map.h", + "safe_queue.h", + "semaphore_ex.h", + "singleton.h", + "sorted_vector.h", + "string_ex.h", + "thread_ex.h", + "thread_pool.h", + "timer.h", + "unique_fd.h" + ], + "header_base": "//commonlibrary/c_utils/base/include" + } + }, { "name": "//commonlibrary/c_utils/base:utilsbase", "header": { -- Gitee