• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 北京万里红科技有限公司
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("//build/ohos.gni")
16
17PCRE2_LIB_DIR = "//third_party/pcre2/pcre2"
18
19ohos_shared_library("libpcre2") {
20  exec_script("/usr/bin/env",
21              [
22                "cp",
23                rebase_path("$PCRE2_LIB_DIR/src/config.h.generic"),
24                rebase_path("$PCRE2_LIB_DIR/src/config.h"),
25              ])
26  exec_script("/usr/bin/env",
27              [
28                "cp",
29                rebase_path("$PCRE2_LIB_DIR/src/pcre2.h.generic"),
30                rebase_path("$PCRE2_LIB_DIR/src/pcre2.h"),
31              ])
32  exec_script("/usr/bin/env",
33              [
34                "cp",
35                rebase_path("$PCRE2_LIB_DIR/src/pcre2_chartables.c.dist"),
36                rebase_path("$PCRE2_LIB_DIR/src/pcre2_chartables.c"),
37              ])
38  output_name = "libpcre2"
39  sources = [
40    "$PCRE2_LIB_DIR/src/pcre2_auto_possess.c",
41    "$PCRE2_LIB_DIR/src/pcre2_chartables.c",
42    "$PCRE2_LIB_DIR/src/pcre2_compile.c",
43    "$PCRE2_LIB_DIR/src/pcre2_config.c",
44    "$PCRE2_LIB_DIR/src/pcre2_context.c",
45    "$PCRE2_LIB_DIR/src/pcre2_convert.c",
46    "$PCRE2_LIB_DIR/src/pcre2_dfa_match.c",
47    "$PCRE2_LIB_DIR/src/pcre2_error.c",
48    "$PCRE2_LIB_DIR/src/pcre2_extuni.c",
49    "$PCRE2_LIB_DIR/src/pcre2_find_bracket.c",
50    "$PCRE2_LIB_DIR/src/pcre2_jit_compile.c",
51    "$PCRE2_LIB_DIR/src/pcre2_maketables.c",
52    "$PCRE2_LIB_DIR/src/pcre2_match.c",
53    "$PCRE2_LIB_DIR/src/pcre2_match_data.c",
54    "$PCRE2_LIB_DIR/src/pcre2_newline.c",
55    "$PCRE2_LIB_DIR/src/pcre2_ord2utf.c",
56    "$PCRE2_LIB_DIR/src/pcre2_pattern_info.c",
57    "$PCRE2_LIB_DIR/src/pcre2_script_run.c",
58    "$PCRE2_LIB_DIR/src/pcre2_serialize.c",
59    "$PCRE2_LIB_DIR/src/pcre2_string_utils.c",
60    "$PCRE2_LIB_DIR/src/pcre2_study.c",
61    "$PCRE2_LIB_DIR/src/pcre2_substitute.c",
62    "$PCRE2_LIB_DIR/src/pcre2_substring.c",
63    "$PCRE2_LIB_DIR/src/pcre2_tables.c",
64    "$PCRE2_LIB_DIR/src/pcre2_ucd.c",
65    "$PCRE2_LIB_DIR/src/pcre2_valid_utf.c",
66    "$PCRE2_LIB_DIR/src/pcre2_xclass.c",
67  ]
68  include_dirs = [ "$PCRE2_LIB_DIR/src" ]
69  cflags = [
70    "-D_GNU_SOURCE",
71    "-DHAVE_CONFIG_H",
72    "-DSUPPORT_PCRE2_8=1",
73    "-DPCRE2_CODE_UNIT_WIDTH=8",
74    "-w",
75  ]
76  install_enable = true
77  install_images = [
78    "system",
79    "ramdisk",
80    "updater",
81  ]
82  license_file = "$PCRE2_LIB_DIR/LICENCE"
83  part_name = "selinux"
84  subsystem_name = "security"
85}
86