1# Copyright (c) 2020-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. 13import("//build/ohos.gni") 14 15brotli_source = [ 16 "c/common/constants.c", 17 "c/common/context.c", 18 "c/common/dictionary.c", 19 "c/common/platform.c", 20 "c/common/shared_dictionary.c", 21 "c/common/transform.c", 22 "c/dec/bit_reader.c", 23 "c/dec/decode.c", 24 "c/dec/huffman.c", 25 "c/dec/state.c", 26 "c/enc/backward_references.c", 27 "c/enc/backward_references_hq.c", 28 "c/enc/bit_cost.c", 29 "c/enc/block_splitter.c", 30 "c/enc/brotli_bit_stream.c", 31 "c/enc/cluster.c", 32 "c/enc/command.c", 33 "c/enc/compound_dictionary.c", 34 "c/enc/compress_fragment.c", 35 "c/enc/compress_fragment_two_pass.c", 36 "c/enc/dictionary_hash.c", 37 "c/enc/encode.c", 38 "c/enc/encoder_dict.c", 39 "c/enc/entropy_encode.c", 40 "c/enc/fast_log.c", 41 "c/enc/histogram.c", 42 "c/enc/literal_cost.c", 43 "c/enc/memory.c", 44 "c/enc/metablock.c", 45 "c/enc/static_dict.c", 46 "c/enc/utf8_util.c", 47] 48 49config("brotli_config") { 50 include_dirs = [ "c/include" ] 51 cflags = [ 52 "-Wno-deprecated-declarations", 53 "-D_GNU_SOURCE", 54 "-D_HAS_EXCEPTIONS=0", 55 "-DHAVE_CONFIG_H", 56 "-Wno-macro-redefined", 57 ] 58} 59 60ohos_shared_library("brotli_shared") { 61 branch_protector_ret = "pac_ret" 62 if (current_os == "ios") { 63 ldflags = [ 64 "-Wl", 65 "-install_name", 66 "@rpath/libbrotli_shared.framework/libbrotli_shared", 67 ] 68 } 69 public_configs = [ ":brotli_config" ] 70 sources = brotli_source 71 install_images = [ 72 "updater", 73 "system", 74 ] 75 innerapi_tags = [ "chipsetsdk_indirect" ] 76 subsystem_name = "thirdparty" 77 part_name = "brotli" 78} 79 80group("brotli_target") { 81 deps = [ "//third_party/brotli:brotli_shared" ] 82} 83