blob: d6114a40ac133406969c1129a487e84883fc70b1 [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//packages/package.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" ]
}
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/Makefile.am",
"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",
]
public_configs = [ ":libxml2_config" ]
configs -= [ "//build/config:symbol_visibility_hidden" ]
configs += [ ":libxml2_private_config" ]
deps = [
"//third_party/zlib",
]
}
package("package") {
system_image = true
package_name = "libxml2"
deps = [
":libxml2",
]
libraries = [ {
name = "libxml2.so"
} ]
}