From ea91b24951ba4507a458353beba0943946d39029 Mon Sep 17 00:00:00 2001 From: Haryslee Date: Fri, 11 Mar 2022 19:53:14 +0800 Subject: [PATCH] fix: add macro Signed-off-by: Haryslee Change-Id: I27f4704c0fab59cbbe1857df525a449cd3839531 --- BUILD.gn | 7 ++++--- frameworks/hal_tick.cpp | 1 + interfaces/innerkits/graphic_config.h | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index ff82835..bcd5335 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -35,7 +35,7 @@ ndk_lib("lite_graphic_utils_ndk") { } lite_library("graphic_utils") { - if (ohos_kernel_type == "liteos_m") { + if (ohos_kernel_type == "liteos_m" || ohos_runtime_is_kernel) { target_type = "static_library" } else { target_type = "shared_library" @@ -62,7 +62,8 @@ lite_library("graphic_utils") { ] include_dirs = [ "frameworks" ] public_configs = [ ":graphic_utils_public_config" ] - if (ohos_kernel_type == "liteos_m") { + public_configs += [ "//kernel/liteos_a:public" ] + if (ohos_kernel_type == "liteos_m" || ohos_runtime_is_kernel) { deps = [ "//third_party/bounds_checking_function:libsec_static" ] public_deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] @@ -83,7 +84,7 @@ config("graphic_utils_public_config") { ] } -if (ohos_kernel_type != "liteos_m") { +if (ohos_kernel_type != "liteos_m" && !ohos_runtime_is_kernel) { lite_component("lite_graphic_hals") { features = [ ":graphic_hals" ] public_deps = features diff --git a/frameworks/hal_tick.cpp b/frameworks/hal_tick.cpp index c908364..20ee327 100755 --- a/frameworks/hal_tick.cpp +++ b/frameworks/hal_tick.cpp @@ -21,6 +21,7 @@ #include #elif defined __linux__ || defined __LITEOS__ || defined __APPLE__ #include +#include "time.h" #else #include "los_tick.h" #endif diff --git a/interfaces/innerkits/graphic_config.h b/interfaces/innerkits/graphic_config.h index 74436f9..5c6aa63 100755 --- a/interfaces/innerkits/graphic_config.h +++ b/interfaces/innerkits/graphic_config.h @@ -57,7 +57,7 @@ namespace OHOS { * VERSION_STANDARD | Standard version * VERSION_EXTENDED | Extended version */ -#ifdef __LITEOS_M__ +#if defined __LITEOS_M__ || defined __LITEOS_A_KERNEL__ #define VERSION_LITE #elif defined _WIN32 || defined __APPLE__ #define VERSION_LITE @@ -70,7 +70,7 @@ namespace OHOS { #define ENABLE_FIXED_POINT 1 #endif -#ifdef __LITEOS_M__ +#if defined __LITEOS_M__ || defined __LITEOS_A_KERNEL__ /** * @brief Font shaping, which is disabled by default on LiteOS. * Cannot take effect without ENABLE_ICU. @@ -414,7 +414,7 @@ static constexpr uint8_t DEFAULT_VECTOR_FONT_SIZE = 18; #endif /* Defines some configurations and their default values on LiteOS and other system platforms. */ -#ifdef __LITEOS_M__ +#if defined __LITEOS_M__ || defined __LITEOS_A_KERNEL__ /* Resolution width of a graphics display screen. The default value is 454. */ #ifndef HORIZONTAL_RESOLUTION @@ -479,7 +479,7 @@ static constexpr const char* DEFAULT_DUMP_DOM_TREE_PATH = ".\\dump_dom_tree.json #define VECTOR_FONT_DIR "..\\..\\tools\\font\\font_tool\\font_tool\\font\\" #endif -#elif defined __LITEOS_M__ // QT_COMPILER +#elif defined __LITEOS_M__ || defined __LITEOS_A_KERNEL__ /* Default file path for screenshots */ static constexpr const char* DEFAULT_SCREENSHOT_PATH = "user/log/screenshot.bin"; -- Gitee