From 71e35c41f8cc5ece03f436ea8d449310f247e821 Mon Sep 17 00:00:00 2001 From: lukai Date: Fri, 15 Jul 2022 16:33:57 +0800 Subject: [PATCH] adapt iccarm compiler issue: https://gitee.com/openharmony/third_party_jerryscript/issues/I5HBPB?from=project-issue Signed-off-by: lukai Change-Id: I5a0a298b3f81aea5ceafed335d789f4b97fabd5c --- jerry-core/BUILD.gn | 21 +++++++++++++++------ jerry-ext/BUILD.gn | 13 +++++++++++-- jerry-libm/BUILD.gn | 11 +++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/jerry-core/BUILD.gn b/jerry-core/BUILD.gn index 879cb6f4..fa3bb1b0 100644 --- a/jerry-core/BUILD.gn +++ b/jerry-core/BUILD.gn @@ -215,18 +215,27 @@ jerry_core_includes = [ ] jerry_core_defines = [ - "JERRY_GLOBAL_HEAP_SIZE = (128)", - "JERRY_ERROR_MESSAGES = 1", - "JERRY_LINE_INFO = 1", + "JERRY_GLOBAL_HEAP_SIZE=(128)", + "JERRY_ERROR_MESSAGES=1", + "JERRY_LINE_INFO=1", "JERRY_FUNCTION_NAME", "JERRY_FUNCTION_BACKTRACE", - "JERRY_STACK_LIMIT = 0", + "JERRY_STACK_LIMIT=0", ] +config("jerry_core_config") { + if (board_toolchain_type == "iccarm") { + cflags = [ + "--diag_suppress", + "Pa089,Pe111,Pe188,Pe191,Pe546,Pe940", + ] + } +} + if (ohos_kernel_type == "liteos_m") { lite_library("jerry-core_static") { target_type = "static_library" - + public_configs = [ ":jerry_core_config" ] sources = jerry_core_sources include_dirs = jerry_core_includes defines = jerry_core_defines @@ -234,7 +243,7 @@ if (ohos_kernel_type == "liteos_m") { } else { lite_library("jerry-core_shared") { target_type = "shared_library" - + public_configs = [ ":jerry_core_config" ] sources = jerry_core_sources include_dirs = jerry_core_includes defines = jerry_core_defines diff --git a/jerry-ext/BUILD.gn b/jerry-ext/BUILD.gn index 86e634ed..53b91721 100644 --- a/jerry-ext/BUILD.gn +++ b/jerry-ext/BUILD.gn @@ -51,17 +51,26 @@ jerry_ext_include_dirs = [ "${core_path}/include", ] +config("jerry_ext_config") { + if (board_toolchain_type == "iccarm") { + cflags = [ + "--diag_suppress", + "Pe940", + ] + } +} + if (ohos_kernel_type == "liteos_m") { lite_library("jerry-ext_static") { target_type = "static_library" - + public_configs = [ ":jerry_ext_config" ] sources = jerry_ext_sources include_dirs = jerry_ext_include_dirs } } else { lite_library("jerry-ext_shared") { target_type = "shared_library" - + public_configs = [ ":jerry_ext_config" ] sources = jerry_ext_sources include_dirs = jerry_ext_include_dirs } diff --git a/jerry-libm/BUILD.gn b/jerry-libm/BUILD.gn index 20d08007..12efe17e 100644 --- a/jerry-libm/BUILD.gn +++ b/jerry-libm/BUILD.gn @@ -56,15 +56,26 @@ jerry_libm_sources = [ jerry_libm_include_dirs = [ "include" ] +config("jerry_libm_config") { + if (board_toolchain_type == "iccarm") { + cflags = [ + "--diag_suppress", + "Pe039,Pa089,Pe222", + ] + } +} + if (ohos_kernel_type == "liteos_m") { lite_library("jerry-libm_static") { target_type = "static_library" + public_configs = [ ":jerry_libm_config" ] sources = jerry_libm_sources include_dirs = jerry_libm_include_dirs } } else { lite_library("jerry-libm_shared") { target_type = "shared_library" + public_configs = [ ":jerry_libm_config" ] sources = jerry_libm_sources include_dirs = jerry_libm_include_dirs } -- Gitee