#Copyright (c) 2020-2022 Huawei Device Co., Ltd. #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, software #distributed under the License is distributed on an "AS IS" BASIS, #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #See the License for the specific language governing permissions and #limitations under the License. import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/subsystem/aafwk/config.gni") import("//foundation/arkui/ace_engine_lite/ace_lite.gni") defines = [] declare_args() { LOSCFG_TEST_JS_BUILD = false } lite_component("jsfwk") { features = [ ":ace_lite" ] } config("ace_lite_config") { include_dirs = ace_lite_include_dirs defines += [ "FEATURE_COMPONENT_TEXT_SPANNABLE=0" ] if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") { cflags = [ "--diag_suppress", "Pe111,Pa137,Pe177,Pa205,Pe226,Pe366,Pe367", ] cflags_cc = cflags } else { cflags_cc = [ "-std=c++14" ] } ldflags = [ "-lstdc++" ] if (ohos_kernel_type == "liteos_m") { ldflags += [ "-lposix" ] } else { ldflags += [ "-lpthread" ] ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ] } } lite_library("ace_lite") { if (ohos_kernel_type == "liteos_m") { target_type = "static_library" } else { target_type = "shared_library" } deps = [ "targets" ] public_configs = [ ":ace_lite_config" ] sources = ace_lite_sources if (ohos_kernel_type == "liteos_m") { sources -= [ "$ACE_LITE_PATH/src/core/context/ace_ability.cpp", "$ACE_LITE_PATH/src/core/modules/dfx_module.cpp", ] sources += [ "$ACE_LITE_PATH/src/core/context/slite_ace_ability.cpp" ] } public_deps = [ "$ACE_LITE_COMMON_PATH:ace_common_lite", "$MODULE_MANAGER_PATH:ace_module_manager_lite", "$NATIVE_ENGINE_PATH:ace_native_engine_lite", "//base/global/i18n_lite/frameworks/i18n:global_i18n", "//base/global/resource_management_lite/frameworks/resmgr_lite:global_resmgr", "//commonlibrary/utils_lite/timer_task:ace_kit_timer", "//foundation/arkui/ui_lite:ui_lite", ] defines += ace_lite_common_defines if (ohos_kernel_type == "liteos_m") { deps += [ ":gen_syscap_module_native_mini" ] sources += [ "$target_out_dir/syscap_module_native_mini.cpp" ] include_dirs = [ "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" ] public_deps += [ "//build/lite/config/component/cJSON:cjson_static", "//foundation/ability/ability_lite/frameworks/ability_lite:ability", "//third_party/bounds_checking_function:libsec_static", "//third_party/jerryscript:jerry_engine", ] } else { public_deps += [ "//base/startup/init/interfaces/innerkits/syscap:syscap", "//build/lite/config/component/cJSON:cjson_shared", "//third_party/bounds_checking_function:libsec_shared", "//third_party/jerryscript/jerry-core:jerry-core_shared", "//third_party/jerryscript/jerry-ext:jerry-ext_shared", "//third_party/jerryscript/jerry-libm:jerry-libm_shared", "//third_party/jerryscript/jerry-port/default:jerry-port-default_shared", ] if (ace_engine_lite_surface_lite_enable) { public_deps += [ "//foundation/graphic/surface_lite:surface_lite" ] } if (ace_engine_lite_kv_store_enable) { public_deps += [] } if (ace_engine_lite_media_lite_enable) { public_deps += [ "//foundation/multimedia/media_lite/frameworks/player_lite:player_lite", ] } if (ace_engine_lite_camera_lite_enable) { public_deps += [ "//foundation/multimedia/camera_lite/frameworks:camera_lite" ] } } defines += [ "GRAPHIC_ENABLE_LINECAP_FLAG=1", "GRAPHIC_ENABLE_LINEJOIN_FLAG=1", "GRAPHIC_ENABLE_ELLIPSE_FLAG=1", "GRAPHIC_ENABLE_BEZIER_ARC_FLAG=1", "GRAPHIC_ENABLE_ARC_FLAG=1", "GRAPHIC_ENABLE_ROUNDEDRECT_FLAG=1", "GRAPHIC_ENABLE_DASH_GENERATE_FLAG=1", "GRAPHIC_ENABLE_BLUR_EFFECT_FLAG=1", "GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG=1", "GRAPHIC_ENABLE_GRADIENT_FILL_FLAG=1", "GRAPHIC_ENABLE_PATTERN_FILL_FLAG=1", "GRAPHIC_ENABLE_DRAW_IMAGE_FLAG=1", "GRAPHIC_ENABLE_DRAW_TEXT_FLAG=1", ] if (ohos_build_type == "debug") { defines += [ "JS_PROFILER=1" ] } else { defines += [ "JS_PROFILER=0" ] } if (LOSCFG_TEST_JS_BUILD) { defines += [ "JSFWK_TEST=1" ] } if (enable_ohos_appexecfwk_feature_ability == true) { defines += [ "ABILITY_WINDOW_SUPPORT" ] defines += [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ] } if (enable_ohos_aafwk_multi_tasks_feature == true) { defines += [ "_MINI_MULTI_TASKS_" ] } } # generate syscap_module_native_mini.cpp action("gen_syscap_module_native_mini") { ace_tools_root = "//foundation/arkui/ace_engine_lite/frameworks/tools" script = "${ace_tools_root}/syscap/syscap_native_api_src_gen.py" args = [ "--syscap-file", rebase_path("${preloader_output_dir}/system/etc/SystemCapability.json"), "--output-file", rebase_path("${target_out_dir}/syscap_module_native_mini.cpp"), ] inputs = [ "${preloader_output_dir}/system/etc/SystemCapability.json" ] outputs = [ "${target_out_dir}/syscap_module_native_mini.cpp" ] }