From 155cbc1e670c0f57aa8ce7e869f0f423adee3b66 Mon Sep 17 00:00:00 2001 From: huangjie Date: Fri, 12 Aug 2022 16:53:14 +0800 Subject: [PATCH] =?UTF-8?q?libxml2=E9=80=82=E9=85=8Dwin=E5=92=8Cmac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangjie --- BUILD.gn | 220 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 126 insertions(+), 94 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index d5eb8c4..d0d3221 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -43,105 +43,128 @@ config("libxml2_private_config") { } } +config("libxml2_adapter_config") { + include_dirs = [] + if (is_mingw) { + include_dirs += + [ "//developtools/global_resource_tool/build/libxml2/win32/include" ] + defines = [ "LIBXML_STATIC" ] + } else if (is_mac) { + defines = [ "LIBXML_THREAD_ENABLED" ] + } + + include_dirs += [ "include" ] + + cflags_cc = [ "-std=c++17" ] + + cflags_c = [ + "-Wno-implicit-fallthrough", + "-Wno-implicit-function-declaration", + "-Wno-int-conversion", + ] +} + 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 = [ - "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", - ] + sources = manager_sources public_configs = [ ":libxml2_config" ] @@ -155,3 +178,12 @@ ohos_shared_library("xml2") { part_name = "libxml2" subsystem_name = "thirdparty" } + +ohos_static_library("libxml2_adapter") { + sources = manager_sources + + public_configs = [ ":libxml2_adapter_config" ] + + part_name = "libxml2" + subsystem_name = "third_party" +} -- Gitee