加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.gn 20.97 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
# Copyright (c) 2021-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.
if (defined(ark_independent_build)) {
import("//js_runtime/js_runtime_config.gni")
import("$build_root/ark.gni")
} else {
import("//ark/js_runtime/js_runtime_config.gni")
import("//build/ohos.gni")
group("ark_js_packages") {
deps = []
if (host_os != "mac") {
deps += [
"//ark/js_runtime:libark_jsruntime",
"//ark/js_runtime/ecmascript/js_vm:ark_js_vm",
"//ark/js_runtime/ecmascript/tooling:libark_ecma_debugger",
]
}
}
group("ark_js_host_windows_tools_packages") {
deps = []
if (host_os != "mac") {
deps += [ "//ark/js_runtime/ecmascript/js_vm:ark_js_vm(//build/toolchain/mingw:mingw_x86_64)" ]
}
}
group("ark_js_host_mac_tools_packages") {
deps = []
if (host_os == "mac") {
deps += [ "//ark/js_runtime/ecmascript/js_vm:ark_js_vm(//build/toolchain/mac:clang_x64)" ]
}
}
group("ark_js_host_linux_tools_packages") {
deps = []
if (host_os != "mac") {
deps +=
[ "//ark/js_runtime/ecmascript/js_vm:ark_js_vm(${host_toolchain})" ]
if (is_standard_system) {
deps += [
"//ark/js_runtime/ecmascript/compiler:ark_aot_compiler(${host_toolchain})",
"//ark/js_runtime/ecmascript/compiler:ark_stub_compiler(${host_toolchain})",
"//ark/js_runtime/ecmascript/compiler:gen_stub_file(${host_toolchain})",
]
}
}
}
group("ark_js_unittest") {
testonly = true
deps = []
if (host_os != "mac") {
deps += [
"//ark/js_runtime/ecmascript/base/tests:unittest",
"//ark/js_runtime/ecmascript/builtins/tests:unittest",
"//ark/js_runtime/ecmascript/containers/tests:unittest",
"//ark/js_runtime/ecmascript/dfx/hprof/tests:unittest",
"//ark/js_runtime/ecmascript/ic/tests:unittest",
"//ark/js_runtime/ecmascript/jobs/tests:unittest",
"//ark/js_runtime/ecmascript/napi/test:unittest",
"//ark/js_runtime/ecmascript/regexp/tests:unittest",
"//ark/js_runtime/ecmascript/snapshot/tests:unittest",
"//ark/js_runtime/ecmascript/tests:unittest",
"//ark/js_runtime/ecmascript/tooling/test:unittest",
"//ark/js_runtime/ecmascript/ts_types/tests:unittest",
]
}
}
group("ark_js_host_unittest") {
testonly = true
deps = []
if (host_os != "mac") {
# js unittest
deps += [
"//ark/js_runtime/ecmascript/base/tests:host_unittest",
"//ark/js_runtime/ecmascript/builtins/tests:host_unittest",
"//ark/js_runtime/ecmascript/containers/tests:host_unittest",
"//ark/js_runtime/ecmascript/dfx/hprof/tests:host_unittest",
"//ark/js_runtime/ecmascript/ic/tests:host_unittest",
"//ark/js_runtime/ecmascript/jobs/tests:host_unittest",
"//ark/js_runtime/ecmascript/napi/test:host_unittest",
"//ark/js_runtime/ecmascript/regexp/tests:host_unittest",
"//ark/js_runtime/ecmascript/snapshot/tests:host_unittest",
"//ark/js_runtime/ecmascript/tests:host_unittest",
"//ark/js_runtime/ecmascript/tooling/test:host_unittest",
"//ark/js_runtime/ecmascript/ts_types/tests:host_unittest",
]
if (is_standard_system) {
deps += [ "//ark/js_runtime/ecmascript/compiler/tests:host_unittest" ]
}
# js bytecode test
deps += [ "//ark/js_runtime/test/moduletest:ark_js_moduletest" ]
# ts aot test and asm test
if (is_standard_system) {
deps += [ "//ark/js_runtime/test/aottest:ark_aot_test" ]
deps += [ "//ark/js_runtime/test/moduletest:ark_asm_test" ]
}
}
}
}
config("ark_jsruntime_public_config") {
configs = [
"$ark_root/libpandabase:arkbase_public_config",
"$ark_root/libpandafile:arkfile_public_config",
"$third_party_gn_path/icu/icu4c:icu_config",
sdk_libc_secshared_config,
"$js_root/ecmascript/compiler:gen_stub_file_dir_config",
]
defines = []
if (!is_mingw && !is_mac) {
defines += [
"ECMASCRIPT_SUPPORT_CPUPROFILER",
"ECMASCRIPT_SUPPORT_SNAPSHOT",
"ECMASCRIPT_SUPPORT_DEBUGGER",
]
}
include_dirs = [
"$js_root",
# Dependent on runtime_core include
"$ark_root/runtime",
"$ark_root",
]
}
intl_sources = [
"ecmascript/builtins/builtins_collator.cpp",
"ecmascript/builtins/builtins_date_time_format.cpp",
"ecmascript/builtins/builtins_displaynames.cpp",
"ecmascript/builtins/builtins_intl.cpp",
"ecmascript/builtins/builtins_list_format.cpp",
"ecmascript/builtins/builtins_locale.cpp",
"ecmascript/builtins/builtins_number_format.cpp",
"ecmascript/builtins/builtins_plural_rules.cpp",
"ecmascript/builtins/builtins_relative_time_format.cpp",
"ecmascript/js_collator.cpp",
"ecmascript/js_date_time_format.cpp",
"ecmascript/js_displaynames.cpp",
"ecmascript/js_list_format.cpp",
"ecmascript/js_locale.cpp",
"ecmascript/js_number_format.cpp",
"ecmascript/js_plural_rules.cpp",
"ecmascript/js_relative_time_format.cpp",
]
config("ark_jsruntime_compiler_config") {
configs = [ "$js_root:ark_jsruntime_common_config" ]
}
config("ark_jsruntime_windows_config") {
ldflags = [ "-lshlwapi" ]
}
config("ark_jsruntime_common_config") {
defines = [ "PANDA_ENABLE_LTO" ]
cflags_cc = [
"-Wall",
"-Wshadow",
"-Werror",
"-Wextra",
"-pedantic",
"-Wno-invalid-offsetof",
"-Wno-gnu-statement-expression",
"-pipe",
"-Wdate-time",
"-Wformat=2",
]
if (defined(ark_independent_build)) {
cflags_cc += [
"-std=c++17",
"-fno-rtti",
]
} else {
if (use_musl) {
defines += [ "PANDA_USE_MUSL" ]
}
}
if (build_public_version) {
defines += [ "IS_PUBLIC_VERSION" ]
}
if (is_linux) {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_LINUX",
"PANDA_USE_FUTEX",
]
} else if (is_mingw) {
cflags_cc += [
"-std=c++17",
"-Wno-ignored-attributes",
]
defines += [
"PANDA_TARGET_WINDOWS",
"_CRTBLD",
"__LIBMSVCRT__",
]
} else if (is_mac) {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_MACOS",
"PANDA_USE_FUTEX",
]
} else {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_USE_FUTEX",
]
if (!is_standard_system && (current_cpu != "arm" || is_wearable_product)) {
defines += [ "PANDA_TARGET_MOBILE" ]
}
}
if (!defined(ark_independent_build)) {
if (!use_libfuzzer) {
cflags_cc += [ "-flto" ]
ldflags = [ "-flto" ]
}
}
if (is_debug) {
cflags_cc += [
"-Og",
"-O0",
"-ggdb3",
]
if (is_linux && (current_cpu == "x86" || current_cpu == "x64") &&
run_with_asan) {
cflags_cc += [
"-fsanitize=address",
"-fno-omit-frame-pointer",
]
ldflags += [ "-L" + rebase_path("${root_out_dir}/ark/ark_js_runtime") ]
libs = [ "clang_rt.asan-x86_64" ]
}
} else {
defines += [ "NDEBUG" ]
}
if (current_cpu == "arm") {
defines += [
"PANDA_TARGET_ARM32_ABI_SOFT=1",
"PANDA_TARGET_ARM32",
"PANDA_TARGET_32",
]
} else if (current_cpu == "arm64") {
defines += [
"PANDA_TARGET_ARM64",
"PANDA_TARGET_64",
"PANDA_ENABLE_GLOBAL_REGISTER_VARIABLES",
"PANDA_USE_32_BIT_POINTER",
]
} else if (current_cpu == "x86") {
defines += [ "PANDA_TARGET_X86" ]
} else if (current_cpu == "amd64" || current_cpu == "x64" ||
current_cpu == "x86_64") {
defines += [
"PANDA_TARGET_64",
"PANDA_TARGET_AMD64",
"PANDA_USE_32_BIT_POINTER",
]
}
}
# ecmascript unit testcase config
config("ecma_test_config") {
visibility = [ ":*" ]
configs = [
"$js_root:ark_jsruntime_public_config",
"$js_root:ark_jsruntime_common_config",
]
ldflags = [ "-Wl,-rpath=\$ORIGIN/" ]
}
# ecmascript icu path for testcase config
config("icu_path_test_config") {
icu_data_path = rebase_path("//third_party/icu/ohos_icu4j/data")
defines = [ "ICU_PATH=\"${icu_data_path}\"" ]
}
ecma_source = [
"ecmascript/base/array_helper.cpp",
"ecmascript/base/builtins_base.cpp",
"ecmascript/base/error_helper.cpp",
"ecmascript/base/json_parser.cpp",
"ecmascript/base/json_stringifier.cpp",
"ecmascript/base/number_helper.cpp",
"ecmascript/base/string_helper.cpp",
"ecmascript/base/typed_array_helper.cpp",
"ecmascript/base/utf_helper.cpp",
"ecmascript/builtins.cpp",
"ecmascript/builtins/builtins_ark_tools.cpp",
"ecmascript/builtins/builtins_array.cpp",
"ecmascript/builtins/builtins_arraybuffer.cpp",
"ecmascript/builtins/builtins_async_function.cpp",
"ecmascript/builtins/builtins_bigint.cpp",
"ecmascript/builtins/builtins_boolean.cpp",
"ecmascript/builtins/builtins_dataview.cpp",
"ecmascript/builtins/builtins_date.cpp",
"ecmascript/builtins/builtins_errors.cpp",
"ecmascript/builtins/builtins_function.cpp",
"ecmascript/builtins/builtins_generator.cpp",
"ecmascript/builtins/builtins_global.cpp",
"ecmascript/builtins/builtins_iterator.cpp",
"ecmascript/builtins/builtins_json.cpp",
"ecmascript/builtins/builtins_map.cpp",
"ecmascript/builtins/builtins_math.cpp",
"ecmascript/builtins/builtins_number.cpp",
"ecmascript/builtins/builtins_object.cpp",
"ecmascript/builtins/builtins_promise.cpp",
"ecmascript/builtins/builtins_promise_handler.cpp",
"ecmascript/builtins/builtins_promise_job.cpp",
"ecmascript/builtins/builtins_proxy.cpp",
"ecmascript/builtins/builtins_reflect.cpp",
"ecmascript/builtins/builtins_regexp.cpp",
"ecmascript/builtins/builtins_set.cpp",
"ecmascript/builtins/builtins_sharedarraybuffer.cpp",
"ecmascript/builtins/builtins_string.cpp",
"ecmascript/builtins/builtins_string_iterator.cpp",
"ecmascript/builtins/builtins_symbol.cpp",
"ecmascript/builtins/builtins_typedarray.cpp",
"ecmascript/builtins/builtins_weak_map.cpp",
"ecmascript/builtins/builtins_weak_set.cpp",
"ecmascript/containers/containers_arraylist.cpp",
"ecmascript/containers/containers_deque.cpp",
"ecmascript/containers/containers_plainarray.cpp",
"ecmascript/containers/containers_private.cpp",
"ecmascript/containers/containers_queue.cpp",
"ecmascript/containers/containers_stack.cpp",
"ecmascript/containers/containers_treemap.cpp",
"ecmascript/containers/containers_treeset.cpp",
"ecmascript/containers/containers_vector.cpp",
"ecmascript/dfx/vmstat/caller_stat.cpp",
"ecmascript/dfx/vmstat/runtime_stat.cpp",
"ecmascript/dfx/vm_thread_control.cpp",
"ecmascript/dump.cpp",
"ecmascript/ecma_string.cpp",
"ecmascript/ecma_string_table.cpp",
"ecmascript/ecma_vm.cpp",
"ecmascript/free_object.cpp",
"ecmascript/file_loader.cpp",
"ecmascript/generator_helper.cpp",
"ecmascript/global_env.cpp",
"ecmascript/global_env_constants.cpp",
"ecmascript/ic/ic_runtime.cpp",
"ecmascript/ic/ic_compare_op.cpp",
"ecmascript/ic/invoke_cache.cpp",
"ecmascript/ic/profile_type_info.cpp",
"ecmascript/ic/property_box.cpp",
"ecmascript/ic/proto_change_details.cpp",
"ecmascript/interpreter/frame_handler.cpp",
"ecmascript/interpreter/interpreter.cpp",
"ecmascript/interpreter/interpreter_assembly.cpp",
"ecmascript/interpreter/slow_runtime_helper.cpp",
"ecmascript/interpreter/slow_runtime_stub.cpp",
"ecmascript/jobs/micro_job_queue.cpp",
"ecmascript/jspandafile/js_pandafile.cpp",
"ecmascript/jspandafile/js_pandafile_manager.cpp",
"ecmascript/jspandafile/class_info_extractor.cpp",
"ecmascript/jspandafile/debug_info_extractor.cpp",
"ecmascript/jspandafile/literal_data_extractor.cpp",
"ecmascript/jspandafile/module_data_extractor.cpp",
"ecmascript/jspandafile/accessor/module_data_accessor.cpp",
"ecmascript/jspandafile/panda_file_translator.cpp",
"ecmascript/jspandafile/js_pandafile_executor.cpp",
"ecmascript/jspandafile/scope_info_extractor.cpp",
"ecmascript/js_api_arraylist.cpp",
"ecmascript/js_api_arraylist_iterator.cpp",
"ecmascript/js_api_deque.cpp",
"ecmascript/js_api_deque_iterator.cpp",
"ecmascript/js_api_plain_array.cpp",
"ecmascript/js_api_plain_array_iterator.cpp",
"ecmascript/js_api_queue.cpp",
"ecmascript/js_api_queue_iterator.cpp",
"ecmascript/js_api_stack.cpp",
"ecmascript/js_api_stack_iterator.cpp",
"ecmascript/js_api_tree_map.cpp",
"ecmascript/js_api_tree_map_iterator.cpp",
"ecmascript/js_api_tree_set.cpp",
"ecmascript/js_api_tree_set_iterator.cpp",
"ecmascript/js_api_vector.cpp",
"ecmascript/js_api_vector_iterator.cpp",
"ecmascript/js_arguments.cpp",
"ecmascript/js_array.cpp",
"ecmascript/js_array_iterator.cpp",
"ecmascript/js_arraybuffer.cpp",
"ecmascript/js_async_function.cpp",
"ecmascript/js_bigint.cpp",
"ecmascript/js_dataview.cpp",
"ecmascript/js_date.cpp",
"ecmascript/js_for_in_iterator.cpp",
"ecmascript/js_function.cpp",
"ecmascript/js_generator_object.cpp",
"ecmascript/js_hclass.cpp",
"ecmascript/js_iterator.cpp",
"ecmascript/js_map.cpp",
"ecmascript/js_map_iterator.cpp",
"ecmascript/js_method.cpp",
"ecmascript/js_object.cpp",
"ecmascript/js_primitive_ref.cpp",
"ecmascript/js_promise.cpp",
"ecmascript/js_proxy.cpp",
"ecmascript/js_regexp_iterator.cpp",
"ecmascript/js_serializer.cpp",
"ecmascript/js_set.cpp",
"ecmascript/js_set_iterator.cpp",
"ecmascript/js_stable_array.cpp",
"ecmascript/js_string_iterator.cpp",
"ecmascript/js_tagged_value.cpp",
"ecmascript/js_thread.cpp",
"ecmascript/js_typed_array.cpp",
"ecmascript/js_weak_container.cpp",
"ecmascript/linked_hash_table.cpp",
"ecmascript/message_string.cpp",
"ecmascript/mem/barriers.cpp",
"ecmascript/mem/c_string.cpp",
"ecmascript/mem/chunk.cpp",
"ecmascript/mem/dyn_chunk.cpp",
"ecmascript/mem/full_gc.cpp",
"ecmascript/mem/concurrent_marker.cpp",
"ecmascript/mem/concurrent_sweeper.cpp",
"ecmascript/mem/free_object_list.cpp",
"ecmascript/mem/free_object_set.cpp",
"ecmascript/mem/gc_stats.cpp",
"ecmascript/mem/heap.cpp",
"ecmascript/mem/heap_region_allocator.cpp",
"ecmascript/mem/linear_space.cpp",
"ecmascript/mem/mem_controller.cpp",
"ecmascript/mem/mem_map_allocator.cpp",
"ecmascript/mem/native_area_allocator.cpp",
"ecmascript/mem/parallel_evacuator.cpp",
"ecmascript/mem/parallel_marker.cpp",
"ecmascript/mem/partial_gc.cpp",
"ecmascript/mem/stw_young_gc.cpp",
"ecmascript/mem/space.cpp",
"ecmascript/mem/sparse_space.cpp",
"ecmascript/mem/verification.cpp",
"ecmascript/mem/work_manager.cpp",
"ecmascript/module/js_module_manager.cpp",
"ecmascript/module/js_module_namespace.cpp",
"ecmascript/module/js_module_record.cpp",
"ecmascript/module/js_module_source_text.cpp",
"ecmascript/napi/jsnapi.cpp",
"ecmascript/object_factory.cpp",
"ecmascript/object_operator.cpp",
"ecmascript/taskpool/taskpool.cpp",
"ecmascript/taskpool/runner.cpp",
"ecmascript/taskpool/task_queue.cpp",
"ecmascript/layout_info.cpp",
"ecmascript/regexp/regexp_executor.cpp",
"ecmascript/regexp/regexp_opcode.cpp",
"ecmascript/regexp/regexp_parser.cpp",
"ecmascript/regexp/regexp_parser_cache.cpp",
"ecmascript/shared_mm/shared_mm.cpp",
"ecmascript/tagged_dictionary.cpp",
"ecmascript/tagged_tree.cpp",
"ecmascript/template_string.cpp",
"ecmascript/weak_vector.cpp",
"ecmascript/compiler/llvm/llvm_stackmap_parser.cpp",
"ecmascript/stubs/runtime_stubs.cpp",
"ecmascript/ts_types/ts_type.cpp",
"ecmascript/ts_types/ts_type_table.cpp",
"ecmascript/ts_types/ts_loader.cpp",
"ecmascript/ts_types/ts_obj_layout_info.cpp",
"ecmascript/stubs/test_runtime_stubs.cpp",
]
if (!is_mingw && !is_mac) {
ecma_source += [ "ecmascript/napi/dfx_jsnapi.cpp" ]
ecma_source += [ "ecmascript/tooling/interface/file_stream.cpp" ]
}
ecma_debugger_source = []
if (!is_mingw && !is_mac) {
ecma_debugger_source += [
"ecmascript/tooling/interface/debugger_api.cpp",
"ecmascript/tooling/interface/js_debugger.cpp",
]
}
ecma_profiler_source = []
if (!is_mingw && !is_mac) {
ecma_profiler_source += [
"ecmascript/dfx/cpu_profiler/cpu_profiler.cpp",
"ecmascript/dfx/cpu_profiler/sampling_processor.cpp",
"ecmascript/dfx/cpu_profiler/samples_record.cpp",
"ecmascript/dfx/hprof/heap_profiler.cpp",
"ecmascript/dfx/hprof/heap_profiler_interface.cpp",
"ecmascript/dfx/hprof/heap_root_visitor.cpp",
"ecmascript/dfx/hprof/heap_snapshot.cpp",
"ecmascript/dfx/hprof/heap_snapshot_json_serializer.cpp",
"ecmascript/dfx/hprof/heap_tracker.cpp",
"ecmascript/dfx/hprof/string_hashmap.cpp",
"ecmascript/snapshot/mem/snapshot.cpp",
"ecmascript/snapshot/mem/snapshot_env.cpp",
"ecmascript/snapshot/mem/snapshot_processor.cpp",
]
}
if (current_cpu == "arm") {
ecma_source += [ "ecmascript/trampoline/arm32/call.S" ]
} else if (current_cpu == "arm64") {
ecma_source += [ "ecmascript/trampoline/aarch64/call.S" ]
} else if (current_cpu == "amd64" || current_cpu == "x64" ||
current_cpu == "x86_64") {
if (is_linux) {
ecma_source += [ "ecmascript/trampoline/x64/call.S" ]
} else if (is_mingw) {
ecma_source += [ "ecmascript/trampoline/win_x64/call.S" ]
} else if (is_mac) {
ecma_source += [ "ecmascript/trampoline/mac_x64/call.S" ]
}
}
source_set("libark_jsruntime_set") {
sources = ecma_source
sources += ecma_profiler_source
sources += ecma_debugger_source
public_configs = [
"$js_root:ark_jsruntime_common_config",
"$js_root:ark_jsruntime_public_config",
]
if (is_mingw) {
public_configs += [ ":ark_jsruntime_windows_config" ]
}
cflags_cc = []
if (is_standard_system) {
cflags_cc += [ "-fvisibility=hidden" ]
}
deps = [
"$ark_root/libpandabase:libarkbase",
"$ark_root/libpandafile:libarkfile",
sdk_libc_secshared_dep,
]
if (is_debug && is_linux && (current_cpu == "x86" || current_cpu == "x64") &&
run_with_asan) {
deps += [ ":copy_asan_runtime" ]
}
if (is_ohos && is_standard_system) {
defines = []
include_dirs = []
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
include_dirs += [ "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
cflags_cc += [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
include_dirs += [ "//base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client" ]
}
}
}
source_set("libark_js_intl_set") {
sources = intl_sources
public_configs = [
"$js_root:ark_jsruntime_common_config",
"$js_root:ark_jsruntime_public_config",
]
deps = [
"$ark_root/libpandabase:libarkbase",
"$ark_root/libpandafile:libarkfile",
"$third_party_gn_path/icu/icu4c:shared_icui18n",
"$third_party_gn_path/icu/icu4c:shared_icuuc",
sdk_libc_secshared_dep,
]
}
source_set("libark_jsruntime_test_set") {
sources = ecma_source
sources += intl_sources
sources += ecma_profiler_source
sources += ecma_debugger_source
deps = [
"$ark_root/libpandabase:libarkbase",
"$ark_root/libpandafile:libarkfile",
"$third_party_gn_path/icu/icu4c:shared_icui18n",
"$third_party_gn_path/icu/icu4c:shared_icuuc",
sdk_libc_secshared_dep,
]
if (is_debug && is_linux && (current_cpu == "x86" || current_cpu == "x64") &&
run_with_asan) {
deps += [ ":copy_asan_runtime" ]
}
public_configs = [
"$js_root:ark_jsruntime_common_config",
"$js_root:ark_jsruntime_public_config",
]
}
if (!defined(ark_independent_build)) {
ohos_shared_library("libark_jsruntime") {
deps = [
":libark_js_intl_set",
":libark_jsruntime_set",
]
if (is_ohos && is_standard_system) {
if (enable_dump_in_faultlog || enable_bytrace) {
external_deps = []
}
if (enable_dump_in_faultlog) {
external_deps += [ "faultloggerd:libfaultloggerd" ]
}
if (enable_bytrace) {
external_deps += [ "hitrace_native:hitrace_meter" ]
}
}
install_enable = true
if (!is_mingw && !is_mac) {
output_extension = "so"
}
if (!is_standard_system) {
relative_install_dir = "ark"
}
part_name = "ark_js_runtime"
subsystem_name = "ark"
}
ohos_shared_library("libark_jsruntime_test") {
deps = [ ":libark_jsruntime_test_set" ]
install_enable = false
if (!is_mingw && !is_mac) {
output_extension = "so"
}
subsystem_name = "test"
}
if (is_debug && is_linux && (current_cpu == "x86" || current_cpu == "x64") &&
run_with_asan) {
ohos_copy("copy_asan_runtime") {
sources = [ "${asan_lib_path}/libclang_rt.asan-x86_64.a" ]
outputs = [ "${root_out_dir}/ark/ark_js_runtime/{{source_file_part}}" ]
}
}
} else {
ark_shared_library("libark_jsruntime") {
deps = [
":libark_js_intl_set",
":libark_jsruntime_set",
]
if (!is_mingw && !is_mac) {
output_extension = "so"
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化