代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/third_party_libxml2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
# This is the configuration needed to use libxml2.
config("libxml2_config") {
include_dirs = [ "include" ]
}
# This is the configuration used to build libxml2 itself. It should not be needed outside of this
# library.
#
# This has to be a config instead of flags directly specified on the libxml2 target so the -Wno-*
# flags are ordered after the -Werror flags from the default configs.
config("libxml2_private_config") {
visibility = [ ":*" ]
cflags = [
"-Wno-empty-body",
"-Wno-incompatible-pointer-types",
"-Wno-missing-field-initializers",
"-Wno-self-assign",
"-Wno-sign-compare",
"-Wno-tautological-pointer-compare",
"-Wno-unused-function",
"-Wno-enum-compare",
]
defines = [
"HAVE_CONFIG_H",
"_REENTRANT",
]
if (is_linux) {
defines += [ "_GNU_SOURCE" ]
}
}
group("libxml2") {
public_deps = [ ":xml2" ]
}
manager_sources = [
"DOCBparser.c",
"HTMLparser.c",
"HTMLtree.c",
"SAX.c",
"SAX2.c",
"buf.c",
"c14n.c",
"catalog.c",
"chvalid.c",
"debugXML.c",
"dict.c",
"encoding.c",
"entities.c",
"error.c",
"globals.c",
"hash.c",
"include/libxml/DOCBparser.h",
"include/libxml/HTMLparser.h",
"include/libxml/HTMLtree.h",
"include/libxml/SAX.h",
"include/libxml/SAX2.h",
"include/libxml/c14n.h",
"include/libxml/catalog.h",
"include/libxml/chvalid.h",
"include/libxml/debugXML.h",
"include/libxml/dict.h",
"include/libxml/encoding.h",
"include/libxml/entities.h",
"include/libxml/globals.h",
"include/libxml/hash.h",
"include/libxml/list.h",
"include/libxml/nanoftp.h",
"include/libxml/nanohttp.h",
"include/libxml/parser.h",
"include/libxml/parserInternals.h",
"include/libxml/pattern.h",
"include/libxml/relaxng.h",
"include/libxml/schemasInternals.h",
"include/libxml/schematron.h",
"include/libxml/threads.h",
"include/libxml/tree.h",
"include/libxml/uri.h",
"include/libxml/valid.h",
"include/libxml/xinclude.h",
"include/libxml/xlink.h",
"include/libxml/xmlIO.h",
"include/libxml/xmlautomata.h",
"include/libxml/xmlerror.h",
"include/libxml/xmlexports.h",
"include/libxml/xmlmemory.h",
"include/libxml/xmlmodule.h",
"include/libxml/xmlreader.h",
"include/libxml/xmlregexp.h",
"include/libxml/xmlsave.h",
"include/libxml/xmlschemas.h",
"include/libxml/xmlschemastypes.h",
"include/libxml/xmlstring.h",
"include/libxml/xmlunicode.h",
"include/libxml/xmlversion.h",
"include/libxml/xmlwriter.h",
"include/libxml/xpath.h",
"include/libxml/xpathInternals.h",
"include/libxml/xpointer.h",
"legacy.c",
"list.c",
"nanoftp.c",
"nanohttp.c",
"parser.c",
"parserInternals.c",
"pattern.c",
"relaxng.c",
"schematron.c",
"threads.c",
"tree.c",
"uri.c",
"valid.c",
"xinclude.c",
"xlink.c",
"xmlIO.c",
"xmlmemory.c",
"xmlmodule.c",
"xmlreader.c",
"xmlregexp.c",
"xmlsave.c",
"xmlschemas.c",
"xmlschemastypes.c",
"xmlstring.c",
"xmlunicode.c",
"xmlwriter.c",
"xpath.c",
"xpointer.c",
"xzlib.c",
]
ohos_shared_library("xml2") {
sources = manager_sources
public_configs = [ ":libxml2_config" ]
configs = [ ":libxml2_private_config" ]
if (is_linux) {
libs = [ "dl" ]
}
deps = [ "//third_party/zlib:libz" ]
part_name = "libxml2"
subsystem_name = "thirdparty"
}
config("libxml2_static_config") {
cflags = [
"-Wno-implicit-fallthrough",
"-Wno-implicit-function-declaration",
"-Wno-int-conversion",
"-Wno-uninitialized",
"-Wno-sometimes-uninitialized",
]
include_dirs = []
if (is_mingw) {
defines = [ "LIBXML_STATIC" ]
include_dirs += [ get_label_info(":libxml2_generate_header",
"target_out_dir") + "/include" ]
} else if (is_mac) {
defines = [ "LIBXML_THREAD_ENABLED" ]
} else if (is_linux) {
include_dirs += [ get_label_info(":libxml2_generate_header",
"target_out_dir") + "/include" ]
} else {
defines = [
"HAVE_CONFIG_H",
"_REENTRANT",
]
}
include_dirs += [ "include" ]
cflags_cc = [ "-std=c++17" ]
}
ohos_static_library("static_libxml2") {
sources = manager_sources
public_configs = [ ":libxml2_static_config" ]
deps = [ ":libxml2_generate_header" ]
subsystem_name = "thirdparty"
part_name = "libxml2"
}
action("libxml2_generate_header") {
script = "generate_header.py"
inputs = [
"config.h.cmake.in",
"include/libxml/xmlversion.h.in",
]
config_json_path = "config_linux.json"
xml_version_json_path = "xml_version.json"
if (is_mingw) {
config_json_path = "config_win.json"
}
inputs += [ config_json_path ]
inputs += [ xml_version_json_path ]
config_path = get_label_info(":libxml2_generate_header", "target_out_dir") +
"/include/config.h"
xmlversion_path =
get_label_info(":libxml2_generate_header", "target_out_dir") +
"/include/libxml/xmlversion.h"
outputs = [
config_path,
xmlversion_path,
]
args = [
"--config-input-path",
rebase_path("config.h.cmake.in", root_build_dir),
"--config-path",
rebase_path(config_path, root_build_dir),
"--xmlversion-input-path",
rebase_path("include/libxml/xmlversion.h.in", root_build_dir),
"--xmlversion-path",
rebase_path(xmlversion_path, root_build_dir),
"--config-json",
rebase_path(config_json_path, root_build_dir),
"--xmlversion-json",
rebase_path(xml_version_json_path, root_build_dir),
]
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。