BUILD.gn 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 2014 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/chromeos/ui_mode.gni")
  5. import("//third_party/protobuf/proto_library.gni")
  6. # The proto files need to be a component to avoid duplicate symbols the way the
  7. # dependency structure is currently. Since proto_library generates a source
  8. # set, here we link the result into a component.
  9. component("proto") {
  10. output_name = "policy_proto"
  11. public_deps = [ ":proto_internal" ]
  12. # Make all direct and indirect depedendencies include the config generated by
  13. # the proto_internal target below. This config adds include paths needed to
  14. # compile the generated protobuf headers.
  15. all_dependent_configs = [ ":proto_internal_config" ]
  16. }
  17. proto_library("policy_common_definitions_compile_proto") {
  18. visibility = [
  19. ":proto_internal",
  20. "//components/policy:chrome_settings_proto_generated_compile_proto",
  21. "//components/policy:cloud_policy_proto_generated_compile_proto",
  22. "//components/policy:generated",
  23. ]
  24. sources = [ "policy_common_definitions.proto" ]
  25. proto_out_dir = "components/policy/proto"
  26. }
  27. proto_library("proto_internal") {
  28. visibility = [ ":proto" ]
  29. sources = [
  30. "device_management_backend.proto",
  31. "policy_signing_key.proto",
  32. "secure_connect.proto",
  33. ]
  34. if (is_chromeos_ash) {
  35. sources += [
  36. "chrome_device_policy.proto",
  37. "install_attributes.proto",
  38. ]
  39. }
  40. if (!is_android && !is_ios) {
  41. sources += [ "chrome_extension_policy.proto" ]
  42. }
  43. extra_configs =
  44. [ "//third_party/private_membership:private_membership_config" ]
  45. import_dirs = [
  46. "//third_party/private_membership/src",
  47. "//third_party/shell-encryption/src",
  48. ".",
  49. ]
  50. link_deps = [
  51. ":policy_common_definitions_compile_proto",
  52. "//third_party/private_membership:private_membership_proto",
  53. ]
  54. cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:"
  55. cc_include = "components/policy/proto/policy_proto_export.h"
  56. component_build_force_source_set = true
  57. defines = [ "POLICY_PROTO_COMPILATION" ]
  58. }