summaryrefslogtreecommitdiff
path: root/chromium/components/policy/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/policy/BUILD.gn')
-rw-r--r--chromium/components/policy/BUILD.gn45
1 files changed, 31 insertions, 14 deletions
diff --git a/chromium/components/policy/BUILD.gn b/chromium/components/policy/BUILD.gn
index 353e8e409ed..c0cad6e3a66 100644
--- a/chromium/components/policy/BUILD.gn
+++ b/chromium/components/policy/BUILD.gn
@@ -72,6 +72,16 @@ cloud_policy_proto_path = "$target_gen_dir/proto/cloud_policy.proto"
cloud_policy_full_runtime_proto_path =
"$target_gen_dir/proto/cloud_policy_full_runtime.proto"
+# This protobuf contains the common definitions of the shared messages
+# between user and device policies
+policy_common_definitions_proto_abspath =
+ "//components/policy/proto/policy_common_definitions.proto"
+
+# This file is used by tools/traffic_annotation/traffic_annotation.proto as it
+# needs a version without LITE_RUNTIME optimization.
+policy_common_definitions_full_runtime_proto_path =
+ "$target_gen_dir/proto/policy_common_definitions_full_runtime.proto"
+
# This is the "full" protobuf, which defines one protobuf message per
# policy. It is also the format currently used by the server.
chrome_settings_proto_path = "$target_gen_dir/proto/chrome_settings.proto"
@@ -86,7 +96,7 @@ constants_source_path = "$target_gen_dir/policy_constants.cc"
app_restrictions_path = "$target_gen_dir/app_restrictions.xml"
risk_tag_header_path = "$target_gen_dir/risk_tag.h"
-action("cloud_policy_code_generate") {
+action("policy_code_generate") {
script = "tools/generate_policy_source.py"
chrome_version_abspath = "//chrome/VERSION"
chrome_version_path = rebase_path(chrome_version_abspath, root_build_dir)
@@ -142,6 +152,7 @@ action("full_runtime_code_generate") {
outputs = [
cloud_policy_full_runtime_proto_path,
chrome_settings_full_runtime_proto_path,
+ policy_common_definitions_full_runtime_proto_path,
]
args = [
@@ -156,6 +167,11 @@ action("full_runtime_code_generate") {
rebase_path(cloud_policy_full_runtime_proto_path, root_build_dir),
"--chrome-settings-full-runtime-protobuf=" +
rebase_path(chrome_settings_full_runtime_proto_path, root_build_dir),
+ "--policy-common-definitions-protobuf=" +
+ rebase_path(policy_common_definitions_proto_abspath, root_build_dir),
+ "--policy-common-definitions-full-runtime-protobuf=" +
+ rebase_path(policy_common_definitions_full_runtime_proto_path,
+ root_build_dir),
]
}
@@ -282,23 +298,22 @@ component("cloud_policy_proto_generated_compile") {
]
}
proto_library("cloud_policy_proto_generated_compile_proto") {
- visibility = [
- ":cloud_policy_proto_generated_compile",
- ":chrome_settings_proto_generated_compile",
- ":chrome_settings_proto_generated_compile_proto",
- ":chrome_settings_proto_generated_compile_proto_gen",
- ]
+ visibility = [ ":cloud_policy_proto_generated_compile" ]
+
sources = [
cloud_policy_proto_path,
]
+ import_dirs = [ "//components/policy/proto" ]
proto_out_dir = "components/policy/proto"
cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:"
cc_include = "components/policy/proto/policy_proto_export.h"
component_build_force_source_set = true
defines = [ "POLICY_PROTO_COMPILATION" ]
- proto_deps = [ ":cloud_policy_code_generate" ]
+ link_deps =
+ [ "//components/policy/proto:policy_common_definitions_compile_proto" ]
+ proto_deps = [ ":policy_code_generate" ]
}
# This target builds the "full" protobuf, used for tests only.
@@ -306,25 +321,26 @@ component("chrome_settings_proto_generated_compile") {
testonly = true
public_deps = [
":chrome_settings_proto_generated_compile_proto",
- ":cloud_policy_proto_generated_compile",
]
}
proto_library("chrome_settings_proto_generated_compile_proto") {
testonly = true
visibility = [ ":chrome_settings_proto_generated_compile" ]
+
sources = [
chrome_settings_proto_path,
]
+ import_dirs = [ "//components/policy/proto" ]
proto_out_dir = "components/policy/proto"
cc_generator_options = "dllexport_decl=POLICY_CHROME_SETTINGS_PROTO_EXPORT:"
cc_include = "components/policy/proto/policy_proto_export.h"
component_build_force_source_set = true
defines = [ "POLICY_CHROME_SETTINGS_PROTO_COMPILATION" ]
- proto_deps = [ ":cloud_policy_code_generate" ]
-
- link_deps = [ ":cloud_policy_proto_generated_compile" ]
+ link_deps =
+ [ "//components/policy/proto:policy_common_definitions_compile_proto" ]
+ proto_deps = [ ":policy_code_generate" ]
}
static_library("generated") {
@@ -336,10 +352,11 @@ static_library("generated") {
defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ]
public_deps = [
- ":cloud_policy_code_generate",
":cloud_policy_proto_generated_compile",
+ ":policy_code_generate",
"//base",
"//components/policy/core/common:common_constants",
+ "//components/policy/proto:policy_common_definitions_compile_proto",
"//third_party/protobuf:protobuf_lite",
]
deps = [
@@ -360,7 +377,7 @@ if (gen_policy_templates_android && is_android) {
"$_generated_resources_dir/xml-v21/app_restrictions.xml",
]
deps = [
- ":cloud_policy_code_generate",
+ ":policy_code_generate",
":policy_templates",
]
}