From 24943570d710d8d6d45308e107282b0eb985f425 Mon Sep 17 00:00:00 2001 From: Parshukov Kirill Date: Tue, 11 Jun 2024 16:46:43 +0300 Subject: [PATCH] Add pcre2-16 target added pcre2-16 target to inner_kits IA4ICO Tests: - Change-Id: I5528f5bfdd4690b0e48b57e449bdcdfb6e31e531 Signed-off-by: Parshukov Kirill --- BUILD.gn | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ bundle.json | 7 +++++ 2 files changed, 86 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 3f18ef0..9f60bf9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -203,3 +203,82 @@ ohos_static_library("libpcre2_static") { part_name = "pcre2" subsystem_name = "thirdparty" } + +ohos_shared_library("libpcre2_16") { + md5_check_script = rebase_path("$PCRE2_LIB_DIR/check_md5.sh") + _arguments_config = [ + rebase_path("$PCRE2_LIB_DIR/src/config.h.generic"), + rebase_path("$PCRE2_LIB_DIR/src/config.h"), + ] + + check_config_result = + exec_script(md5_check_script, _arguments_config, "string") + if (check_config_result == "") { + exec_script("/usr/bin/env", + [ + "cp", + "-f", + rebase_path("$PCRE2_LIB_DIR/src/config.h.generic"), + rebase_path("$PCRE2_LIB_DIR/src/config.h"), + ]) + } + + _arguments_pcre2 = [ + rebase_path("$PCRE2_LIB_DIR/src/pcre2.h.generic"), + rebase_path("$PCRE2_LIB_DIR/src/pcre2.h"), + ] + + check_pcre2_result = exec_script(md5_check_script, _arguments_pcre2, "string") + if (check_pcre2_result == "") { + exec_script("/usr/bin/env", + [ + "cp", + "-f", + rebase_path("$PCRE2_LIB_DIR/src/pcre2.h.generic"), + rebase_path("$PCRE2_LIB_DIR/src/pcre2.h"), + ]) + } + + _arguments_pcre2_chartables = [ + rebase_path("$PCRE2_LIB_DIR/src/pcre2_chartables.c.dist"), + rebase_path("$PCRE2_LIB_DIR/src/pcre2_chartables.c"), + ] + + check_pcre2_chartables_result = + exec_script(md5_check_script, _arguments_pcre2_chartables, "string") + if (check_pcre2_chartables_result == "") { + exec_script("/usr/bin/env", + [ + "cp", + "-f", + rebase_path("$PCRE2_LIB_DIR/src/pcre2_chartables.c.dist"), + rebase_path("$PCRE2_LIB_DIR/src/pcre2_chartables.c"), + ]) + } + + output_name = "libpcre2_16" + sources = pcre2_sources + sources += [ "$PCRE2_LIB_DIR/src/pcre2_chartables.c" ] + include_dirs = [ "$PCRE2_LIB_DIR/src" ] + public_configs = [ ":third_party_pcre2_config" ] + cflags = [ + "-D_GNU_SOURCE", + "-DHAVE_CONFIG_H", + "-DSUPPORT_PCRE2_16=1", + "-DPCRE2_CODE_UNIT_WIDTH=16", + "-w", + ] + install_enable = true + install_images = [ + "system", + "ramdisk", + "updater", + ] + license_file = "$PCRE2_LIB_DIR/LICENCE" + innerapi_tags = [ + "platformsdk_indirect", + "chipsetsdk_indirect", + ] + part_name = "pcre2" + subsystem_name = "thirdparty" +} diff --git a/bundle.json b/bundle.json index 4e91562..f88eb80 100644 --- a/bundle.json +++ b/bundle.json @@ -38,6 +38,13 @@ "header_files": [], "header_base": "//third_party/pcre2/pcre2/src" } + }, + { + "name": "//third_party/pcre2:libpcre2_16", + "header": { + "header_files": [], + "header_base": "//third_party/pcre2/pcre2/src" + } } ], "test": [] -- Gitee