blob: dbf45368ffe0bb996055dbcddc6f29db1aee7270 [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//common-mk/proto_library.gni")
import("//common-mk/xml2cpp.gni")
genxml2cpp("modemmanager-dbus-adaptors") {
xml2cpp_type = "adaptor"
xml2cpp_in_dir = "${sysroot}/usr/share/dbus-1/interfaces/"
xml2cpp_out_dir = "include/dbus_adaptors"
sources = [
"${xml2cpp_in_dir}/mm-mobile-error.xml",
"${xml2cpp_in_dir}/mm-serial-error.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Cdma.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Firmware.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Gsm.Card.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Gsm.Contacts.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Gsm.Network.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Gsm.SMS.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Gsm.Ussd.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Gsm.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.Simple.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.Modem.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Bearer.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Modem.Location.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Modem.ModemCdma.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Modem.Simple.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Modem.Time.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Modem.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.Sim.xml",
"${xml2cpp_in_dir}/org.freedesktop.ModemManager1.xml",
]
}
genxml2cpp("dbus-proxies") {
xml2cpp_type = "proxy"
xml2cpp_in_dir = "${sysroot}/usr/share/dbus-1/interfaces/"
xml2cpp_out_dir = "include/dbus_proxies"
sources = [ "${xml2cpp_in_dir}/org.freedesktop.DBus.Properties.xml" ]
}
action("cloud_policy_proto_generator") {
policy_resources_dir = "${sysroot}/usr/share/policy_resources"
proto_out_dir = "${target_gen_dir}/proto"
policy_tools_dir = "${sysroot}/usr/share/policy_tools"
script = "${policy_tools_dir}/generate_policy_source.py"
sources = [
"${policy_resources_dir}/VERSION",
"${policy_resources_dir}/policy_templates.json",
]
outputs = [ "${proto_out_dir}/cloud_policy.proto" ]
args = [
"--cloud-policy-protobuf=${proto_out_dir}/cloud_policy.proto",
"--chrome-version-file=${policy_resources_dir}/VERSION",
"--target-platform=chromeos",
"--policy-templates-file=${policy_resources_dir}/policy_templates.json",
]
}
proto_library("policy_common_definitions-protos") {
proto_in_dir = "${sysroot}/usr/share/protofiles"
proto_out_dir = "include/bindings"
sources = [ "${proto_in_dir}/policy_common_definitions.proto" ]
# policy-protos.a is used by a shared_libary object: https://crbug.com/715795
# Build it with '-fPIC' instead of '-fPIE'.
configs = [ "//common-mk:pic" ]
}
proto_library("policy-protos") {
proto_in_dir = "${sysroot}/usr/share/protofiles"
proto_out_dir = "include/bindings"
proto_lib_dirs = [ "${sysroot}/usr/share/protofiles" ]
sources = [
"${proto_in_dir}/chrome_device_policy.proto",
"${proto_in_dir}/chrome_extension_policy.proto",
"${proto_in_dir}/device_management_backend.proto",
]
public_deps = [ ":policy_common_definitions-protos" ]
# policy-protos.a is used by a shared_libary object: https://crbug.com/715795
# Build it with '-fPIC' instead of '-fPIE'.
configs = [ "//common-mk:pic" ]
}
goproto_library("policy-goprotos") {
proto_in_dir = "${sysroot}/usr/share/protofiles"
# Package name needs to match with the one declared in .proto files.
proto_out_dir = "go/src/chromiumos/policy/enterprise_management"
sources = [
"${proto_in_dir}/chrome_device_policy.proto",
"${proto_in_dir}/chrome_extension_policy.proto",
"${proto_in_dir}/device_management_backend.proto",
"${proto_in_dir}/policy_common_definitions.proto",
]
}
proto_library("user_policy-protos") {
proto_in_dir = "${target_gen_dir}/proto"
proto_out_dir = "include/bindings"
proto_lib_dirs = [ "${sysroot}/usr/share/protofiles" ]
sources = [ "${proto_in_dir}/cloud_policy.proto" ]
deps = [ ":cloud_policy_proto_generator" ]
public_deps = [ ":policy_common_definitions-protos" ]
}
proto_library("install_attributes-proto") {
proto_in_dir = "${sysroot}/usr/include/proto"
proto_out_dir = "include/bindings"
sources = [ "${proto_in_dir}/install_attributes.proto" ]
# install_attributes-proto.a is used by a shared_libary.
# Build it with '-fPIC' instead of '-fPIE'.
configs = [ "//common-mk:pic" ]
}