diff --git a/jerry-core/BUILD.gn b/jerry-core/BUILD.gn index fa3bb1b031f947bfd8d3f1e9bf0b261d211cae89..aff10c4040655ebf8274d69fadf50627214a09c4 100644 --- a/jerry-core/BUILD.gn +++ b/jerry-core/BUILD.gn @@ -214,36 +214,75 @@ jerry_core_includes = [ "$core_path", ] -jerry_core_defines = [ - "JERRY_GLOBAL_HEAP_SIZE=(128)", - "JERRY_ERROR_MESSAGES=1", - "JERRY_LINE_INFO=1", - "JERRY_FUNCTION_NAME", - "JERRY_FUNCTION_BACKTRACE", - "JERRY_STACK_LIMIT=0", -] - -config("jerry_core_config") { - if (board_toolchain_type == "iccarm") { +if (board_toolchain_type != "iccarm") { + jerry_core_defines = [ + "JERRY_GLOBAL_HEAP_SIZE=(128)", + "JERRY_ERROR_MESSAGES=1", + "JERRY_LINE_INFO=1", + "JERRY_FUNCTION_NAME", + "JERRY_FUNCTION_BACKTRACE", + "JERRY_STACK_LIMIT=0", + ] +} else { + jerry_core_sources += [ + "api/external-context-helpers.c", + "api/generate-bytecode.c", + "api/jerryscript_adapter.c", + ] + config("jerry_core_config") { cflags = [ "--diag_suppress", "Pa089,Pe111,Pe188,Pe191,Pe546,Pe940", ] + defines = [ + "JERRY_FOR_IAR_CONFIG", + "JERRY_GC_LIMIT=(0)", + "JERRY_CPOINTER_32_BIT=0", + "JERRY_ERROR_MESSAGES=1", + "JERRY_EXTERNAL_CONTEXT=1", + "JERRY_PARSER=1", + "JERRY_LINE_INFO=1", + "JERRY_LOGGING=0", + "JERRY_DEBUGGER=0", + "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", + "JERRY_PARSER_DUMP_BYTE_CODE=0", + "JERRY_ES2015=0", + "JERRY_REGEXP_STRICT_MODE=0", + "JERRY_REGEXP_DUMP_BYTE_CODE=0", + "JERRY_SNAPSHOT_EXEC=1", + "JERRY_SNAPSHOT_SAVE=1", + "JERRY_SYSTEM_ALLOCATOR=0", + "JERRY_VALGRIND=0", + "JERRY_VM_EXEC_STOP=0", + "JERRY_STACK_LIMIT=(8)", + "JERRY_IAR_JUPITER", + "INPUTJS_BUFFER_SIZE=64*1024", + "SNAPSHOT_BUFFER_SIZE=48*1024", + "_BSD_SOURCE", + ] + include_dirs = jerry_core_includes + include_dirs += [ + "$port_path", + "$port_path/default/include", + "//utils/native/lite/memory/include", + ] } } 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 + if (board_toolchain_type == "iccarm") { + public_configs = [ ":jerry_core_config" ] + } else { + include_dirs = jerry_core_includes + defines = jerry_core_defines + } } } 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 53b91721bcebd7fedc4376a03ffa75440f7f8e80..33b2ee84dabdb3251fa27c82d0758aa210453bdb 100644 --- a/jerry-ext/BUILD.gn +++ b/jerry-ext/BUILD.gn @@ -51,26 +51,59 @@ jerry_ext_include_dirs = [ "${core_path}/include", ] -config("jerry_ext_config") { - if (board_toolchain_type == "iccarm") { +if (board_toolchain_type == "iccarm") { + config("jerry_ext_config") { cflags = [ "--diag_suppress", "Pe940", ] + defines = [ + "JERRY_FOR_IAR_CONFIG", + "JERRY_GC_LIMIT=(0)", + "JERRY_CPOINTER_32_BIT=0", + "JERRY_ERROR_MESSAGES=1", + "JERRY_EXTERNAL_CONTEXT=1", + "JERRY_PARSER=1", + "JERRY_LINE_INFO=1", + "JERRY_LOGGING=0", + "JERRY_DEBUGGER=0", + "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", + "JERRY_PARSER_DUMP_BYTE_CODE=0", + "JERRY_ES2015=0", + "JERRY_REGEXP_STRICT_MODE=0", + "JERRY_REGEXP_DUMP_BYTE_CODE=0", + "JERRY_SNAPSHOT_EXEC=1", + "JERRY_SNAPSHOT_SAVE=1", + "JERRY_SYSTEM_ALLOCATOR=0", + "JERRY_VALGRIND=0", + "JERRY_VM_EXEC_STOP=0", + "JERRY_STACK_LIMIT=(8)", + "JERRY_IAR_JUPITER", + "INPUTJS_BUFFER_SIZE=64*1024", + "SNAPSHOT_BUFFER_SIZE=48*1024", + ] + include_dirs = jerry_ext_include_dirs + include_dirs += [ + "${core_path}", + "${core_path}/jrt", + "//utils/native/lite/memory/include", + ] } } 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 + if (board_toolchain_type == "iccarm") { + public_configs = [ ":jerry_ext_config" ] + } else { + 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-port/default/BUILD.gn b/jerry-port/default/BUILD.gn index 317d01038c912af3b5e6edca8d2691dad5a73c37..15e9430d21b048f4a6c39a3b5b13b2acc9996fb8 100644 --- a/jerry-port/default/BUILD.gn +++ b/jerry-port/default/BUILD.gn @@ -36,12 +36,71 @@ jerry_port_default_include_dirs = [ "${core_path}/include", ] +if (board_toolchain_type == "iccarm") { + config("jerry_port_default_config") { + cflags = [ + "--diag_suppress", + "Pe111", + ] + defines = [ + "JERRY_FOR_IAR_CONFIG", + "JERRY_GC_LIMIT=(0)", + "JERRY_CPOINTER_32_BIT=0", + "JERRY_ERROR_MESSAGES=1", + "JERRY_EXTERNAL_CONTEXT=1", + "JERRY_PARSER=1", + "JERRY_LINE_INFO=1", + "JERRY_LOGGING=0", + "JERRY_DEBUGGER=0", + "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", + "JERRY_PARSER_DUMP_BYTE_CODE=0", + "JERRY_ES2015=0", + "JERRY_REGEXP_STRICT_MODE=0", + "JERRY_REGEXP_DUMP_BYTE_CODE=0", + "JERRY_SNAPSHOT_EXEC=1", + "JERRY_SNAPSHOT_SAVE=1", + "JERRY_SYSTEM_ALLOCATOR=0", + "JERRY_VALGRIND=0", + "JERRY_VM_EXEC_STOP=0", + "JERRY_STACK_LIMIT=(8)", + "JERRY_IAR_JUPITER", + "INPUTJS_BUFFER_SIZE=64*1024", + "SNAPSHOT_BUFFER_SIZE=48*1024", + ] + include_dirs = jerry_port_default_include_dirs + include_dirs += [ + "${core_path}", + "${core_path}/include", + "${core_path}/api", + "${core_path}/debugger", + "${core_path}/ecma/base", + "${core_path}/ecma/builtin-objects", + "${core_path}/ecma/builtin-objects/typedarray", + "${core_path}/ecma/operations", + "${core_path}/ext", + "${core_path}/jcontext", + "${core_path}/jmem", + "${core_path}/jrt", + "${core_path}/lit", + "${core_path}/parser", + "${core_path}/parser/js", + "${core_path}/parser/regexp", + "${core_path}/vm", + "${port_path}", + "//utils/native/lite/memory/include", + ] + } +} + if (ohos_kernel_type == "liteos_m") { lite_library("jerry-port-default_static") { target_type = "static_library" - sources = jerry_port_default_sources - include_dirs = jerry_port_default_include_dirs + if (board_toolchain_type == "iccarm") { + public_configs = [ ":jerry_port_default_config" ] + } else { + include_dirs = jerry_port_default_include_dirs + } } } else { lite_library("jerry-port-default_shared") {