1# Copyright (c) 2021-2023 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("//build/ohos.gni") 15 16THIRDPARTY_RE2_SUBSYS_NAME = "thirdparty" 17THIRDPARTY_RE2_PART_NAME = "re2" 18 19libre2_path = rebase_path("//third_party/re2") 20exec_script("install.sh", [ "$libre2_path" ]) 21 22RE2_DIR = rebase_path("//third_party/re2/re2") 23 24config("re2_public_config") { 25 include_dirs = [ "${RE2_DIR}/" ] 26} 27ohos_shared_library("re2") { 28 sources = [ 29 "${RE2_DIR}/re2/bitmap256.h", 30 "${RE2_DIR}/re2/bitstate.cc", 31 "${RE2_DIR}/re2/compile.cc", 32 "${RE2_DIR}/re2/dfa.cc", 33 "${RE2_DIR}/re2/filtered_re2.cc", 34 "${RE2_DIR}/re2/mimics_pcre.cc", 35 "${RE2_DIR}/re2/nfa.cc", 36 "${RE2_DIR}/re2/onepass.cc", 37 "${RE2_DIR}/re2/parse.cc", 38 "${RE2_DIR}/re2/perl_groups.cc", 39 "${RE2_DIR}/re2/pod_array.h", 40 "${RE2_DIR}/re2/prefilter.cc", 41 "${RE2_DIR}/re2/prefilter.h", 42 "${RE2_DIR}/re2/prefilter_tree.cc", 43 "${RE2_DIR}/re2/prefilter_tree.h", 44 "${RE2_DIR}/re2/prog.cc", 45 "${RE2_DIR}/re2/prog.h", 46 "${RE2_DIR}/re2/re2.cc", 47 "${RE2_DIR}/re2/regexp.cc", 48 "${RE2_DIR}/re2/regexp.h", 49 "${RE2_DIR}/re2/set.cc", 50 "${RE2_DIR}/re2/simplify.cc", 51 "${RE2_DIR}/re2/sparse_array.h", 52 "${RE2_DIR}/re2/sparse_set.h", 53 "${RE2_DIR}/re2/stringpiece.cc", 54 "${RE2_DIR}/re2/tostring.cc", 55 "${RE2_DIR}/re2/unicode_casefold.cc", 56 "${RE2_DIR}/re2/unicode_casefold.h", 57 "${RE2_DIR}/re2/unicode_groups.cc", 58 "${RE2_DIR}/re2/unicode_groups.h", 59 "${RE2_DIR}/re2/walker-inl.h", 60 "${RE2_DIR}/util/logging.h", 61 "${RE2_DIR}/util/mix.h", 62 "${RE2_DIR}/util/mutex.h", 63 "${RE2_DIR}/util/rune.cc", 64 "${RE2_DIR}/util/strutil.cc", 65 "${RE2_DIR}/util/strutil.h", 66 "${RE2_DIR}/util/utf.h", 67 "${RE2_DIR}/util/util.h", 68 ] 69 include_dirs = [ "re2" ] 70 if (!is_asan && !is_debug) { 71 version_script = "libre2.map" 72 } 73 public_configs = [ ":re2_public_config" ] 74 install_enable = true 75 subsystem_name = "${THIRDPARTY_RE2_SUBSYS_NAME}" 76 part_name = "${THIRDPARTY_RE2_PART_NAME}" 77} 78