#Copyright (c) 2020-2021 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/ace/ace_engine_lite/ace_lite.gni") declare_args() { LOSCFG_TEST_JS_BUILD = false } lite_component("jsfwk") { features = [ ":ace_lite" ] } config("ace_lite_config") { include_dirs = ace_lite_include_dirs 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", ] } 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/resmgr_lite/frameworks/resmgr_lite:global_resmgr", "//foundation/graphic/ui:lite_ui", "//utils/native/lite/timer_task:ace_kit_timer", ] if (ohos_kernel_type == "liteos_m") { public_deps += [ "//build/lite/config/component/cJSON:cjson_static", "//third_party/bounds_checking_function:libsec_static", "//third_party/jerryscript:jerry_engine", ] } else { public_deps += [ "//build/lite/config/component/cJSON:cjson_shared", "//foundation/graphic/surface:lite_surface", "//foundation/multimedia/camera_lite/frameworks:camera_lite", "//foundation/multimedia/media_lite/frameworks/player_lite:player_lite", "//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", ] } defines = [] 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" ] } }