chromium/third_party/libjingle_xmpp/BUILD.gn

# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")

config("libjingle_xmpp_common_config") {
  defines = [ "EXPAT_RELATIVE_PATH" ]
}

static_library("rtc_xmllite") {
  visibility = [
    ":*",
    "//remoting/*",
  ]
  sources = [
    "xmllite/qname.cc",
    "xmllite/qname.h",
    "xmllite/xmlbuilder.cc",
    "xmllite/xmlbuilder.h",
    "xmllite/xmlconstants.cc",
    "xmllite/xmlconstants.h",
    "xmllite/xmlelement.cc",
    "xmllite/xmlelement.h",
    "xmllite/xmlnsstack.cc",
    "xmllite/xmlnsstack.h",
    "xmllite/xmlparser.cc",
    "xmllite/xmlparser.h",
    "xmllite/xmlprinter.cc",
    "xmllite/xmlprinter.h",
  ]

  deps = [ "//base" ]
  public_deps = [ "//third_party/expat" ]
  all_dependent_configs = [ ":libjingle_xmpp_common_config" ]
}

fuzzer_test("libjingle_xmpp_xmlparser_fuzzer") {
  sources = [ "xmllite/xmlparser_fuzzer.cc" ]
  deps = [ ":rtc_xmllite" ]
}

test("libjingle_xmpp_unittests") {
  deps = [
    ":rtc_xmllite",
    "//base/test:run_all_unittests",
    "//base/test:test_support",
    "//testing/gtest",
    "//third_party/webrtc_overrides:webrtc_component",
  ]

  sources = [
    "xmllite/qname_unittest.cc",
    "xmllite/xmlbuilder_unittest.cc",
    "xmllite/xmlelement_unittest.cc",
    "xmllite/xmlnsstack_unittest.cc",
    "xmllite/xmlparser_unittest.cc",
    "xmllite/xmlprinter_unittest.cc",
  ]
}