| # 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", |
| "${proto_in_dir}/private_membership.proto", |
| "${proto_in_dir}/private_membership_rlwe.proto", |
| "${proto_in_dir}/serialization.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" ] |
| } |
| |
| group("policy-goprotos") { |
| # TODO(https://crbug.com/1164401) The protos compiled below are missing |
| # |option go_package| statements. We currently fix this by adding |
| # |import_mapping| to the build rules. The goproto libraries will need to be # updated once the packages are added. |
| deps = [ |
| ":enterprise_management_goprotos", |
| ":private_membership_goprotos", |
| ":private_membership_rlwe_goprotos", |
| ":rlwe_goprotos", |
| ] |
| } |
| |
| goproto_library("enterprise_management_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" |
| import_mapping = [ |
| "private_membership_rlwe.proto=chromiumos/policy/private_membership.rlwe", |
| ] |
| |
| 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", |
| ] |
| } |
| |
| goproto_library("private_membership_rlwe_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/private_membership.rlwe" |
| |
| import_mapping = [ |
| "private_membership.proto=chromiumos/policy/private_membership", |
| "serialization.proto=chromiumos/policy/rlwe", |
| ] |
| |
| sources = [ "${proto_in_dir}/private_membership_rlwe.proto" ] |
| } |
| |
| goproto_library("private_membership_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/private_membership" |
| sources = [ "${proto_in_dir}/private_membership.proto" ] |
| } |
| |
| goproto_library("rlwe_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/rlwe" |
| sources = [ "${proto_in_dir}/serialization.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" ] |
| } |