2022-03-22 14:41:04 +00:00
|
|
|
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
2021-09-04 08:04:43 +00:00
|
|
|
# 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.
|
|
|
|
|
2022-07-11 07:35:26 +00:00
|
|
|
import("//arkcompiler/runtime_core/ark_config.gni")
|
2021-09-04 08:04:43 +00:00
|
|
|
|
|
|
|
config("arkfile_public_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"$ark_root/libpandafile",
|
|
|
|
"$ark_root/libziparchive",
|
|
|
|
"$target_gen_dir",
|
|
|
|
"$target_gen_dir/include",
|
|
|
|
]
|
|
|
|
|
2024-01-19 03:20:26 +00:00
|
|
|
defines = []
|
2022-08-09 07:03:29 +00:00
|
|
|
if (is_ohos && !is_standard_system) {
|
2024-01-19 03:20:26 +00:00
|
|
|
defines += [ "ENABLE_FULL_FILE_FIELDS" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (use_libfuzzer) {
|
2024-03-19 06:12:07 +00:00
|
|
|
defines += [ "FATAL_AS_ERROR" ]
|
2022-08-09 07:03:29 +00:00
|
|
|
}
|
2021-09-04 08:04:43 +00:00
|
|
|
}
|
|
|
|
|
2022-10-27 12:04:12 +00:00
|
|
|
config("arkfile_fuzz_config") {
|
2022-11-01 02:21:11 +00:00
|
|
|
configs = [ "$build_root/config/compiler:exceptions" ]
|
2022-10-27 12:04:12 +00:00
|
|
|
defines = [ "SUPPORT_KNOWN_EXCEPTION" ]
|
|
|
|
}
|
|
|
|
|
2024-03-19 06:12:07 +00:00
|
|
|
config("arkfile_verifier_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"$ark_root/libpandafile",
|
|
|
|
"$ark_root/libziparchive",
|
|
|
|
"$target_gen_dir",
|
|
|
|
"$target_gen_dir/include",
|
|
|
|
]
|
|
|
|
|
|
|
|
defines = []
|
|
|
|
if (is_ohos && !is_standard_system) {
|
|
|
|
defines += [ "ENABLE_FULL_FILE_FIELDS" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
defines += [ "FATAL_AS_ERROR" ]
|
|
|
|
}
|
|
|
|
|
2021-09-04 08:04:43 +00:00
|
|
|
libarkfile_sources = [
|
|
|
|
"annotation_data_accessor.cpp",
|
|
|
|
"bytecode_emitter.cpp",
|
|
|
|
"class_data_accessor.cpp",
|
|
|
|
"code_data_accessor.cpp",
|
|
|
|
"debug_data_accessor.cpp",
|
|
|
|
"debug_info_extractor.cpp",
|
|
|
|
"field_data_accessor.cpp",
|
|
|
|
"file.cpp",
|
2021-09-08 02:01:07 +00:00
|
|
|
"file_format_version.cpp",
|
2021-09-04 08:04:43 +00:00
|
|
|
"file_item_container.cpp",
|
|
|
|
"file_items.cpp",
|
|
|
|
"file_writer.cpp",
|
|
|
|
"literal_data_accessor.cpp",
|
|
|
|
"method_data_accessor.cpp",
|
|
|
|
"method_handle_data_accessor.cpp",
|
2022-08-18 13:21:08 +00:00
|
|
|
"module_data_accessor.cpp",
|
2022-07-16 09:41:58 +00:00
|
|
|
"pgo.cpp",
|
2021-09-04 08:04:43 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
libarkfile_configs = [
|
|
|
|
"$ark_root:ark_config",
|
|
|
|
"$ark_root/libpandabase:arkbase_public_config",
|
|
|
|
":arkfile_public_config",
|
|
|
|
]
|
|
|
|
|
2024-04-06 02:07:39 +00:00
|
|
|
ohos_static_library("arkfile_header_deps") {
|
2021-09-04 08:04:43 +00:00
|
|
|
deps = [
|
|
|
|
":isa_gen_libarkfile_bytecode_emitter_def_gen_h",
|
|
|
|
":isa_gen_libarkfile_bytecode_emitter_gen_h",
|
|
|
|
":isa_gen_libarkfile_bytecode_instruction-inl_gen_h",
|
|
|
|
":isa_gen_libarkfile_bytecode_instruction_enum_gen_h",
|
2021-09-07 13:51:18 +00:00
|
|
|
":isa_gen_libarkfile_file_format_version_h",
|
2021-09-04 08:04:43 +00:00
|
|
|
":isa_gen_libarkfile_tests_bytecode_emitter_tests_gen_h",
|
|
|
|
":libarkfile_type_gen_h",
|
2022-07-16 09:41:58 +00:00
|
|
|
":source_lang_enum_h",
|
2022-07-30 14:33:01 +00:00
|
|
|
"$ark_root/libpandabase:arkbase_header_deps",
|
|
|
|
]
|
2024-04-06 02:07:39 +00:00
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
2022-07-30 14:33:01 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 02:07:39 +00:00
|
|
|
ohos_static_library("libarkfile_static") {
|
2022-07-30 14:33:01 +00:00
|
|
|
sources = libarkfile_sources
|
|
|
|
|
|
|
|
public_configs = libarkfile_configs
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":arkfile_header_deps",
|
2022-07-29 02:30:54 +00:00
|
|
|
"$ark_root/libpandabase:libarkbase_static",
|
|
|
|
"$ark_root/libziparchive:libarkziparchive_static",
|
2021-09-04 08:04:43 +00:00
|
|
|
]
|
2024-03-23 07:44:27 +00:00
|
|
|
|
|
|
|
external_deps = [ sdk_libc_secshared_dep ]
|
2024-03-30 02:07:29 +00:00
|
|
|
if (!ark_standalone_build) {
|
|
|
|
public_external_deps = [ "zlib:libz" ]
|
|
|
|
} else {
|
|
|
|
external_deps += [ "zlib:libz" ]
|
|
|
|
}
|
2024-03-23 07:44:27 +00:00
|
|
|
|
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
2022-04-26 07:10:29 +00:00
|
|
|
}
|
|
|
|
|
2024-03-23 07:44:27 +00:00
|
|
|
ohos_source_set("libarkfile_static_fuzz") {
|
2022-10-27 12:04:12 +00:00
|
|
|
sources = libarkfile_sources
|
|
|
|
|
|
|
|
public_configs = libarkfile_configs
|
|
|
|
public_configs += [ ":arkfile_fuzz_config" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":arkfile_header_deps",
|
|
|
|
"$ark_root/libpandabase:libarkbase_static",
|
|
|
|
"$ark_root/libziparchive:libarkziparchive_static",
|
|
|
|
]
|
2024-03-23 07:44:27 +00:00
|
|
|
|
|
|
|
external_deps = [ sdk_libc_secshared_dep ]
|
2024-03-30 02:07:29 +00:00
|
|
|
if (!ark_standalone_build) {
|
|
|
|
public_external_deps = [ "zlib:libz" ]
|
|
|
|
} else {
|
|
|
|
external_deps += [ "zlib:libz" ]
|
|
|
|
}
|
2024-03-23 07:44:27 +00:00
|
|
|
|
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
2022-10-27 12:04:12 +00:00
|
|
|
}
|
|
|
|
|
2024-03-19 06:12:07 +00:00
|
|
|
source_set("libarkfile_static_verifier") {
|
|
|
|
sources = libarkfile_sources
|
|
|
|
|
|
|
|
public_configs = [
|
|
|
|
"$ark_root:ark_config",
|
|
|
|
"$ark_root/libpandabase:arkbase_public_config",
|
|
|
|
":arkfile_verifier_config",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":arkfile_header_deps",
|
|
|
|
"$ark_root/libpandabase:libarkbase_static",
|
|
|
|
"$ark_root/libziparchive:libarkziparchive_static",
|
|
|
|
]
|
2024-04-08 07:27:44 +00:00
|
|
|
external_deps = []
|
|
|
|
external_deps += [
|
2024-04-07 04:01:03 +00:00
|
|
|
"zlib:shared_libz",
|
|
|
|
sdk_libc_secshared_dep,
|
|
|
|
]
|
2024-03-19 06:12:07 +00:00
|
|
|
}
|
|
|
|
|
2022-04-26 07:10:29 +00:00
|
|
|
ohos_shared_library("libarkfile") {
|
2023-05-08 14:22:11 +00:00
|
|
|
stack_protector_ret = false
|
2022-04-26 07:10:29 +00:00
|
|
|
deps = [ ":libarkfile_static" ]
|
2021-09-04 08:04:43 +00:00
|
|
|
|
|
|
|
if (!is_standard_system) {
|
|
|
|
relative_install_dir = "ark"
|
|
|
|
}
|
2022-05-19 02:34:24 +00:00
|
|
|
if (!is_mingw && !is_mac) {
|
|
|
|
output_extension = "so"
|
2022-04-21 04:32:23 +00:00
|
|
|
}
|
2022-07-16 09:41:58 +00:00
|
|
|
|
2022-10-13 07:57:44 +00:00
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
2021-09-04 08:04:43 +00:00
|
|
|
}
|
|
|
|
|
2024-03-23 07:44:27 +00:00
|
|
|
ohos_source_set("libarkfile_frontend_set_static") {
|
2021-09-04 08:04:43 +00:00
|
|
|
sources = libarkfile_sources
|
|
|
|
|
2022-04-26 07:10:29 +00:00
|
|
|
public_configs = libarkfile_configs
|
2021-09-04 08:04:43 +00:00
|
|
|
|
|
|
|
deps = [
|
2022-07-30 14:33:01 +00:00
|
|
|
":arkfile_header_deps",
|
2021-09-04 08:04:43 +00:00
|
|
|
"$ark_root/libpandabase:libarkbase_frontend_static",
|
|
|
|
"$ark_root/libziparchive:libarkziparchive_frontend_static",
|
|
|
|
]
|
2024-03-23 07:44:27 +00:00
|
|
|
|
|
|
|
external_deps = [ sdk_libc_secshared_dep ]
|
2024-03-30 02:07:29 +00:00
|
|
|
if (!ark_standalone_build) {
|
|
|
|
public_external_deps = [ "zlib:libz" ]
|
|
|
|
} else {
|
|
|
|
external_deps += [ "zlib:libz" ]
|
|
|
|
}
|
2024-03-23 07:44:27 +00:00
|
|
|
|
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
2022-04-26 07:10:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ohos_static_library("libarkfile_frontend_static") {
|
2023-05-08 14:22:11 +00:00
|
|
|
stack_protector_ret = false
|
2022-04-26 07:10:29 +00:00
|
|
|
deps = [ ":libarkfile_frontend_set_static" ]
|
2022-03-14 02:48:57 +00:00
|
|
|
|
2022-10-13 07:57:44 +00:00
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
2021-09-04 08:04:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ark_gen_file("libarkfile_type_gen_h") {
|
|
|
|
template_file = "templates/type.h.erb"
|
|
|
|
data_file = "types.yaml"
|
|
|
|
requires = [ "types.rb" ]
|
|
|
|
output_file = "$target_gen_dir/type.h"
|
|
|
|
}
|
|
|
|
|
|
|
|
ark_isa_gen("isa_gen_libarkfile") {
|
|
|
|
template_files = [
|
2023-03-20 12:56:31 +00:00
|
|
|
"arkcompiler.para.erb",
|
2021-09-04 08:04:43 +00:00
|
|
|
"bytecode_instruction_enum_gen.h.erb",
|
|
|
|
"bytecode_instruction-inl_gen.h.erb",
|
|
|
|
"bytecode_emitter_def_gen.h.erb",
|
|
|
|
"bytecode_emitter_gen.h.erb",
|
2021-09-07 13:51:18 +00:00
|
|
|
"file_format_version.h.erb",
|
2021-09-04 08:04:43 +00:00
|
|
|
"tests/bytecode_emitter_tests_gen.h.erb",
|
|
|
|
]
|
|
|
|
sources = "templates" ## ark_root/templates
|
|
|
|
destination = "$target_gen_dir/include" ## target_gen_dir/include
|
|
|
|
requires = [ "pandafile_isapi.rb" ]
|
|
|
|
}
|
2022-07-16 09:41:58 +00:00
|
|
|
|
|
|
|
ark_gen_file("source_lang_enum_h") {
|
|
|
|
extra_dependencies = [ "$ark_root:concat_plugins_yamls" ]
|
|
|
|
template_file = "templates/source_lang_enum.h.erb"
|
|
|
|
data_file = "$target_gen_dir/../plugin_options.yaml"
|
|
|
|
requires = [ "$ark_root/templates/plugin_options.rb" ]
|
|
|
|
output_file = "$target_gen_dir/include/source_lang_enum.h"
|
|
|
|
}
|
2023-03-20 12:56:31 +00:00
|
|
|
|
|
|
|
group("arkcompiler_params") {
|
|
|
|
deps = []
|
|
|
|
|
|
|
|
if (!ark_standalone_build) {
|
|
|
|
deps += [ ":arkcompiler.para" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ark_standalone_build) {
|
|
|
|
ohos_prebuilt_etc("arkcompiler.para") {
|
|
|
|
deps = [ ":isa_gen_libarkfile_arkcompiler_para" ]
|
|
|
|
source = "$target_gen_dir/include/arkcompiler.para"
|
|
|
|
relative_install_dir = "param"
|
|
|
|
part_name = "runtime_core"
|
|
|
|
subsystem_name = "arkcompiler"
|
|
|
|
}
|
|
|
|
}
|