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") 23ohos_shared_library("re2") { 24 sources = [ 25 "${RE2_DIR}/re2/bitmap256.h", 26 "${RE2_DIR}/re2/bitstate.cc", 27 "${RE2_DIR}/re2/compile.cc", 28 "${RE2_DIR}/re2/dfa.cc", 29 "${RE2_DIR}/re2/filtered_re2.cc", 30 "${RE2_DIR}/re2/mimics_pcre.cc", 31 "${RE2_DIR}/re2/nfa.cc", 32 "${RE2_DIR}/re2/onepass.cc", 33 "${RE2_DIR}/re2/parse.cc", 34 "${RE2_DIR}/re2/perl_groups.cc", 35 "${RE2_DIR}/re2/pod_array.h", 36 "${RE2_DIR}/re2/prefilter.cc", 37 "${RE2_DIR}/re2/prefilter.h", 38 "${RE2_DIR}/re2/prefilter_tree.cc", 39 "${RE2_DIR}/re2/prefilter_tree.h", 40 "${RE2_DIR}/re2/prog.cc", 41 "${RE2_DIR}/re2/prog.h", 42 "${RE2_DIR}/re2/re2.cc", 43 "${RE2_DIR}/re2/regexp.cc", 44 "${RE2_DIR}/re2/regexp.h", 45 "${RE2_DIR}/re2/set.cc", 46 "${RE2_DIR}/re2/simplify.cc", 47 "${RE2_DIR}/re2/sparse_array.h", 48 "${RE2_DIR}/re2/sparse_set.h", 49 "${RE2_DIR}/re2/stringpiece.cc", 50 "${RE2_DIR}/re2/tostring.cc", 51 "${RE2_DIR}/re2/unicode_casefold.cc", 52 "${RE2_DIR}/re2/unicode_casefold.h", 53 "${RE2_DIR}/re2/unicode_groups.cc", 54 "${RE2_DIR}/re2/unicode_groups.h", 55 "${RE2_DIR}/re2/walker-inl.h", 56 "${RE2_DIR}/util/logging.h", 57 "${RE2_DIR}/util/mix.h", 58 "${RE2_DIR}/util/mutex.h", 59 "${RE2_DIR}/util/rune.cc", 60 "${RE2_DIR}/util/strutil.cc", 61 "${RE2_DIR}/util/strutil.h", 62 "${RE2_DIR}/util/utf.h", 63 "${RE2_DIR}/util/util.h", 64 ] 65 include_dirs = [ "re2" ] 66 if (!is_asan && !is_debug) { 67 version_script = "libre2.map" 68 } 69 install_enable = true 70 subsystem_name = "${THIRDPARTY_RE2_SUBSYS_NAME}" 71 part_name = "${THIRDPARTY_RE2_PART_NAME}" 72} 73