1# Copyright (c) 2021-2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//arkcompiler/runtime_core/static_core/ark_config.gni") 15if (ark_standalone_build) { 16 import("$build_root/ark.gni") 17} else { 18 import("//build/ohos.gni") 19} 20 21config("arkziparchive_config") { 22 include_dirs = [ 23 "$ark_root/libziparchive", 24 "$ark_root/libpandabase", 25 ] 26 27 if (ark_standalone_build) { 28 include_dirs += [ "//third_party/zlib/contrib/minizip" ] 29 } 30} 31 32ohos_source_set("libarktsziparchive_static") { 33 sources = [ 34 "extractortool/extractor.cpp", 35 "extractortool/file_mapper.cpp", 36 "extractortool/zip_file.cpp", 37 "extractortool/zip_file_reader.cpp", 38 "extractortool/zip_file_reader_io.cpp", 39 "zip_archive.cpp", 40 ] 41 42 public_configs = [ 43 ":arkziparchive_config", 44 "$ark_root:ark_config", 45 "$ark_root/libpandabase:arkbase_public_config", 46 ] 47 48 deps = [ "$ark_root/libpandabase:libarktsbase" ] 49 50 if (ark_static_standalone_build) { 51 public_configs += [ zlib_public_config ] 52 deps += [ zlib_dep ] 53 } 54 55 external_deps = [ 56 sdk_libc_secshared_dep, 57 zlib_dep, 58 ] 59 60 part_name = ark_part_name 61 subsystem_name = "$ark_subsystem_name" 62} 63 64ohos_shared_library("libarktsziparchive") { 65 deps = [ ":libarktsziparchive_static" ] 66 67 if (is_mingw || is_win) { 68 output_extension = "dll" 69 } else { 70 output_extension = "so" 71 } 72 part_name = ark_part_name 73 subsystem_name = "$ark_subsystem_name" 74} 75 76ohos_source_set("libarktsziparchive_frontend_set_static") { 77 sources = [ "zip_archive.cpp" ] 78 79 public_configs = [ 80 ":arkziparchive_config", 81 "$ark_root:ark_config", 82 "$ark_root/libpandabase:arkbase_public_config", 83 ] 84 85 deps = [ "$ark_root/libpandabase:logger_enum_gen_h" ] 86 87 if (ark_static_standalone_build || ark_standalone_build) { 88 public_configs += [ zlib_public_config ] 89 } 90 91 if (ark_static_standalone_build) { 92 deps += [ 93 sdk_libc_secshared_dep, 94 zlib_dep, 95 ] 96 } 97 98 external_deps = [ 99 sdk_libc_secshared_dep, 100 zlib_dep, 101 ] 102 103 part_name = ark_part_name 104 subsystem_name = "$ark_subsystem_name" 105} 106 107ohos_static_library("libarktsziparchive_frontend_static") { 108 deps = [ ":libarktsziparchive_frontend_set_static" ] 109 part_name = ark_part_name 110 subsystem_name = ark_subsystem_name 111} 112