- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / app / policy / cloud_policy_codegen.gyp
1 # Copyright (c) 2012 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
5 {
6   'variables': {
7     'chromium_code': 1,
8     'policy_out_dir': '<(SHARED_INTERMEDIATE_DIR)/policy',
9     'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
10     'generate_policy_source_script_path':
11         '<(DEPTH)/chrome/tools/build/generate_policy_source.py',
12     'policy_constant_header_path':
13         '<(policy_out_dir)/policy/policy_constants.h',
14     'policy_constant_source_path':
15         '<(policy_out_dir)/policy/policy_constants.cc',
16     'protobuf_decoder_path':
17         '<(policy_out_dir)/policy/cloud_policy_generated.cc',
18     # This is the "full" protobuf, which defines one protobuf message per
19     # policy. It is also the format currently used by the server.
20     'chrome_settings_proto_path':
21         '<(policy_out_dir)/policy/chrome_settings.proto',
22     # This protobuf is equivalent to chrome_settings.proto but shares messages
23     # for policies of the same type, so that less classes have to be generated
24     # and compiled.
25     'cloud_policy_proto_path': '<(policy_out_dir)/policy/cloud_policy.proto',
26   },
27   'targets': [
28     {
29       'target_name': 'cloud_policy_code_generate',
30       'type': 'none',
31       'actions': [
32         {
33           'inputs': [
34             'policy_templates.json',
35             '<(generate_policy_source_script_path)',
36           ],
37           'outputs': [
38             '<(policy_constant_header_path)',
39             '<(policy_constant_source_path)',
40             '<(protobuf_decoder_path)',
41             '<(chrome_settings_proto_path)',
42             '<(cloud_policy_proto_path)',
43           ],
44           'action_name': 'generate_policy_source',
45           'action': [
46             'python',
47             '<@(generate_policy_source_script_path)',
48             '--policy-constants-header=<(policy_constant_header_path)',
49             '--policy-constants-source=<(policy_constant_source_path)',
50             '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
51             '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
52             '--cloud-policy-decoder=<(protobuf_decoder_path)',
53             '<(OS)',
54             '<(chromeos)',
55             'policy_templates.json',
56           ],
57           'message': 'Generating policy source',
58         },
59       ],
60       'direct_dependent_settings': {
61         'include_dirs': [
62           '<(policy_out_dir)',
63           '<(protoc_out_dir)',
64         ],
65       },
66     },
67     {
68       'target_name': 'cloud_policy_proto_generated_compile',
69       'type': 'static_library',
70       'sources': [
71         '<(cloud_policy_proto_path)',
72       ],
73       'variables': {
74         'proto_in_dir': '<(policy_out_dir)/policy',
75         'proto_out_dir': 'policy/proto',
76       },
77       'dependencies': [
78         'cloud_policy_code_generate',
79       ],
80       'includes': [ '../../../build/protoc.gypi' ],
81       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
82       'msvs_disabled_warnings': [4267, ],
83     },
84     {
85       # This target builds the "full" protobuf, used for tests only.
86       'target_name': 'chrome_settings_proto_generated_compile',
87       'type': 'static_library',
88       'sources': [
89         '<(chrome_settings_proto_path)',
90       ],
91       'variables': {
92         'proto_in_dir': '<(policy_out_dir)/policy',
93         'proto_out_dir': 'policy/proto',
94       },
95       'dependencies': [
96         'cloud_policy_code_generate',
97         'cloud_policy_proto_generated_compile',
98       ],
99       'includes': [ '../../../build/protoc.gypi' ],
100     },
101     {
102       'target_name': 'policy',
103       'type': 'static_library',
104       'hard_dependency': 1,
105       'direct_dependent_settings': {
106         'include_dirs': [
107           '<(policy_out_dir)',
108           '<(protoc_out_dir)',
109         ],
110       },
111       'sources': [
112         '<(policy_constant_header_path)',
113         '<(policy_constant_source_path)',
114         '<(protobuf_decoder_path)',
115       ],
116       'include_dirs': [
117         '<(DEPTH)',
118       ],
119       'dependencies': [
120         'cloud_policy_code_generate',
121         'cloud_policy_proto_generated_compile',
122         '<(DEPTH)/base/base.gyp:base',
123         '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
124       ],
125     },
126     {
127       'target_name': 'policy_test_support',
128       'type': 'none',
129       'hard_dependency': 1,
130       'direct_dependent_settings': {
131         'include_dirs': [
132           '<(policy_out_dir)',
133           '<(protoc_out_dir)',
134         ],
135       },
136       'dependencies': [
137         'policy',
138         'chrome_settings_proto_generated_compile',
139       ],
140     },
141   ],
142   'conditions': [
143     ['OS=="win" and target_arch=="ia32"', {
144       'targets': [
145         {
146           'target_name': 'policy_win64',
147           'type': 'static_library',
148           'hard_dependency': 1,
149           'sources': [
150             '<(policy_constant_header_path)',
151             '<(policy_constant_source_path)',
152           ],
153           'include_dirs': [
154             '<(DEPTH)',
155           ],
156           'direct_dependent_settings':  {
157             'include_dirs': [
158               '<(policy_out_dir)'
159             ],
160           },
161           'dependencies': [
162             'cloud_policy_code_generate',
163           ],
164           'configurations': {
165             'Common_Base': {
166               'msvs_target_platform': 'x64',
167             },
168           },
169         },
170       ],
171     }],
172   ],  # 'conditions'
173 }