mirror of
https://github.com/openharmony/third_party_pcre2.git
synced 2026-07-01 10:05:26 -04:00
ee67e16702
Issue: https://gitcode.com/openharmony/arkcompiler_runtime_core/issues/9847 Signed-off-by: zhangmingqi <zhangmingqi9@huawei.com>
171 lines
4.9 KiB
Plaintext
171 lines
4.9 KiB
Plaintext
import("//build/config/components/ets_frontend/ets_frontend_config.gni")
|
|
if (ark_standalone_build) {
|
|
import("$build_root/ark.gni")
|
|
} else {
|
|
import("//build/ohos.gni")
|
|
}
|
|
|
|
PCRE2_LIB_DIR = "//third_party/pcre2/pcre2"
|
|
PCRE2_ARKTS_DIR = "//third_party/pcre2/pcre2_ArkTS"
|
|
|
|
# use action replace exec_script
|
|
action("copy_generic_files") {
|
|
script = rebase_path("//third_party/pcre2/copy_generic_files.sh")
|
|
inputs = [
|
|
"$PCRE2_LIB_DIR/src/config.h.generic",
|
|
"$PCRE2_LIB_DIR/src/pcre2.h.generic",
|
|
"$PCRE2_LIB_DIR/src/pcre2_chartables.c.dist",
|
|
]
|
|
outputs = [
|
|
"${target_gen_dir}/src/pcre2_chartables.c",
|
|
]
|
|
args = [
|
|
rebase_path("$PCRE2_LIB_DIR"),
|
|
rebase_path("${target_gen_dir}"),
|
|
]
|
|
}
|
|
|
|
# srcs depended by glib
|
|
ohos_shared_headers("pcre2_generated_headers") {
|
|
include_dirs = [get_label_info(":copy_generic_files", "target_gen_dir") + "/src"]
|
|
deps = [":copy_generic_files"]
|
|
part_name = "pcre2"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
# include dir depended by glib
|
|
ohos_prebuilt_etc("publish_generic_file") {
|
|
source = get_label_info(":copy_generic_files", "target_gen_dir") + "/src/pcre2_chartables.c"
|
|
output = "pcre2_chartables.c"
|
|
part_name = "pcre2"
|
|
install_enable = false
|
|
subsystem_name = "thirdparty"
|
|
deps = [":copy_generic_files"]
|
|
}
|
|
|
|
config("third_party_pcre2_config") {
|
|
include_dirs = [ "$PCRE2_LIB_DIR/src" ]
|
|
include_dirs += [ "${target_gen_dir}/src" ]
|
|
}
|
|
|
|
pcre2_sources = [
|
|
"$PCRE2_LIB_DIR/src/pcre2_auto_possess.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_chkdint.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_compile.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_compile_class.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_config.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_context.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_convert.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_dfa_match.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_error.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_extuni.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_find_bracket.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_jit_compile.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_maketables.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_match.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_match_data.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_newline.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_ord2utf.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_pattern_info.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_script_run.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_serialize.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_string_utils.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_study.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_substitute.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_substring.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_tables.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_ucd.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_valid_utf.c",
|
|
"$PCRE2_LIB_DIR/src/pcre2_xclass.c",
|
|
]
|
|
|
|
ohos_shared_library("libpcre2") {
|
|
deps = [ ":publish_generic_file" ]
|
|
branch_protector_ret = "pac_ret"
|
|
output_name = "libpcre2"
|
|
sources = pcre2_sources
|
|
sources += get_target_outputs(":publish_generic_file")
|
|
public_configs = [ ":third_party_pcre2_config" ]
|
|
cflags = [
|
|
"-D_GNU_SOURCE",
|
|
"-DHAVE_CONFIG_H",
|
|
"-DSUPPORT_PCRE2_8=1",
|
|
"-DPCRE2_CODE_UNIT_WIDTH=8",
|
|
"-w",
|
|
]
|
|
install_enable = true
|
|
install_images = [
|
|
"system",
|
|
"ramdisk",
|
|
"updater",
|
|
]
|
|
license_file = "$PCRE2_LIB_DIR/LICENCE.md"
|
|
innerapi_tags = [
|
|
"platformsdk_indirect",
|
|
"chipsetsdk_sp_indirect",
|
|
]
|
|
part_name = "pcre2"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
ohos_static_library("libpcre2_static") {
|
|
deps = [ ":publish_generic_file" ]
|
|
output_name = "libpcre2_static"
|
|
sources = pcre2_sources
|
|
sources += get_target_outputs(":publish_generic_file")
|
|
public_configs = [ ":third_party_pcre2_config" ]
|
|
cflags = [
|
|
"-D_GNU_SOURCE",
|
|
"-DHAVE_CONFIG_H",
|
|
"-DSUPPORT_PCRE2_8=1",
|
|
"-DPCRE2_CODE_UNIT_WIDTH=8",
|
|
"-w",
|
|
]
|
|
license_file = "$PCRE2_LIB_DIR/LICENCE.md"
|
|
part_name = "pcre2"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
ohos_static_library("libpcre2_static_8") {
|
|
deps = [ ":publish_generic_file" ]
|
|
output_name = "libpcre2_static_8"
|
|
sources = pcre2_sources
|
|
sources -= [ "$PCRE2_LIB_DIR/src/pcre2_newline.c" ]
|
|
sources += [ "$PCRE2_ARKTS_DIR/pcre2_newline_static.c" ]
|
|
sources += get_target_outputs(":publish_generic_file")
|
|
public_configs = [ ":third_party_pcre2_config" ]
|
|
cflags = [
|
|
"-D_GNU_SOURCE",
|
|
"-DHAVE_CONFIG_H",
|
|
"-DSUPPORT_PCRE2_8=1",
|
|
"-DSUPPORT_UNICODE=1",
|
|
"-DPCRE2_CODE_UNIT_WIDTH=8",
|
|
"-w",
|
|
]
|
|
license_file = "$PCRE2_LIB_DIR/LICENCE.md"
|
|
part_name = "pcre2"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
ohos_static_library("libpcre2_static_16") {
|
|
deps = [ ":publish_generic_file" ]
|
|
output_name = "libpcre2_static_16"
|
|
sources = pcre2_sources
|
|
sources -= [ "$PCRE2_LIB_DIR/src/pcre2_newline.c" ]
|
|
sources += [ "$PCRE2_ARKTS_DIR/pcre2_newline_static.c" ]
|
|
sources -= [ "$PCRE2_LIB_DIR/src/pcre2_chkdint.c" ]
|
|
sources += get_target_outputs(":publish_generic_file")
|
|
public_configs = [ ":third_party_pcre2_config" ]
|
|
cflags = [
|
|
"-D_GNU_SOURCE",
|
|
"-DHAVE_CONFIG_H",
|
|
"-DSUPPORT_PCRE2_16=1",
|
|
"-DSUPPORT_UNICODE=1",
|
|
"-DPCRE2_CODE_UNIT_WIDTH=16",
|
|
"-w",
|
|
]
|
|
license_file = "$PCRE2_LIB_DIR/LICENCE.md"
|
|
part_name = "pcre2"
|
|
subsystem_name = "thirdparty"
|
|
}
|