Updating trunk VERSION from 750.0 to 751.0
[chromium-blink-merge.git] / sandbox / sandbox.gyp
blob22d88ac1d1e9f0b02e91fc4bf17c6d7f92f99db7
1 # Copyright (c) 2011 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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'target_defaults': {
10     'variables': {
11       'sandbox_windows_target': 0,
12     },
13     'target_conditions': [
14       ['sandbox_windows_target==1', {
15         # Files that are shared between the 32-bit and the 64-bit versions
16         # of the Windows sandbox library.
17         'sources': [
18             'src/acl.cc',
19             'src/acl.h',
20             'src/broker_services.cc',
21             'src/broker_services.h',
22             'src/crosscall_client.h',
23             'src/crosscall_params.h',
24             'src/crosscall_server.cc',
25             'src/crosscall_server.h',
26             'src/dep.cc',
27             'src/dep.h',
28             'src/eat_resolver.cc',
29             'src/eat_resolver.h',
30             'src/filesystem_dispatcher.cc',
31             'src/filesystem_dispatcher.h',
32             'src/filesystem_interception.cc',
33             'src/filesystem_interception.h',
34             'src/filesystem_policy.cc',
35             'src/filesystem_policy.h',
36             'src/interception.cc',
37             'src/interception.h',
38             'src/interception_agent.cc',
39             'src/interception_agent.h',
40             'src/interception_internal.h',
41             'src/interceptors.h',
42             'src/internal_types.h',
43             'src/ipc_tags.h',
44             'src/job.cc',
45             'src/job.h',
46             'src/named_pipe_dispatcher.cc',
47             'src/named_pipe_dispatcher.h',
48             'src/named_pipe_interception.cc',
49             'src/named_pipe_interception.h',
50             'src/named_pipe_policy.cc',
51             'src/named_pipe_policy.h',
52             'src/nt_internals.h',
53             'src/policy_broker.cc',
54             'src/policy_broker.h',
55             'src/policy_engine_opcodes.cc',
56             'src/policy_engine_opcodes.h',
57             'src/policy_engine_params.h',
58             'src/policy_engine_processor.cc',
59             'src/policy_engine_processor.h',
60             'src/policy_low_level.cc',
61             'src/policy_low_level.h',
62             'src/policy_params.h',
63             'src/policy_target.cc',
64             'src/policy_target.h',
65             'src/process_thread_dispatcher.cc',
66             'src/process_thread_dispatcher.h',
67             'src/process_thread_interception.cc',
68             'src/process_thread_interception.h',
69             'src/process_thread_policy.cc',
70             'src/process_thread_policy.h',
71             'src/registry_dispatcher.cc',
72             'src/registry_dispatcher.h',
73             'src/registry_interception.cc',
74             'src/registry_interception.h',
75             'src/registry_policy.cc',
76             'src/registry_policy.h',
77             'src/resolver.cc',
78             'src/resolver.h',
79             'src/restricted_token_utils.cc',
80             'src/restricted_token_utils.h',
81             'src/restricted_token.cc',
82             'src/restricted_token.h',
83             'src/sandbox_factory.h',
84             'src/sandbox_nt_types.h',
85             'src/sandbox_nt_util.cc',
86             'src/sandbox_nt_util.h',
87             'src/sandbox_policy_base.cc',
88             'src/sandbox_policy_base.h',
89             'src/sandbox_policy.h',
90             'src/sandbox_types.h',
91             'src/sandbox_utils.cc',
92             'src/sandbox_utils.h',
93             'src/sandbox.cc',
94             'src/sandbox.h',
95             'src/security_level.h',
96             'src/service_resolver.cc',
97             'src/service_resolver.h',
98             'src/shared_handles.cc',
99             'src/shared_handles.h',
100             'src/sharedmem_ipc_client.cc',
101             'src/sharedmem_ipc_client.h',
102             'src/sharedmem_ipc_server.cc',
103             'src/sharedmem_ipc_server.h',
104             'src/sid.cc',
105             'src/sid.h',
106             'src/sync_dispatcher.cc',
107             'src/sync_dispatcher.h',
108             'src/sync_interception.cc',
109             'src/sync_interception.h',
110             'src/sync_policy.cc',
111             'src/sync_policy.h',
112             'src/target_interceptions.cc',
113             'src/target_interceptions.h',
114             'src/target_process.cc',
115             'src/target_process.h',
116             'src/target_services.cc',
117             'src/target_services.h',
118             'src/win_utils.cc',
119             'src/win_utils.h',
120             'src/win2k_threadpool.cc',
121             'src/win2k_threadpool.h',
122             'src/window.cc',
123             'src/window.h',
124         ],
125       }],
126     ],
127   },
128   'conditions': [
129     [ 'OS=="freebsd" or OS=="openbsd"', {
130       # GYP requires that each file have at least one target defined.
131       'targets': [
132         {
133           'target_name': 'sandbox',
134           'type': 'settings',
135         },
136       ],
137     }],
138     [ 'OS=="linux" and selinux==0 and clang==0', {
139       'targets': [
140         {
141           'target_name': 'chrome_sandbox',
142           'type': 'executable',
143           'sources': [
144             'linux/suid/linux_util.c',
145             'linux/suid/linux_util.h',
146             'linux/suid/process_util.h',
147             'linux/suid/process_util_linux.c',
148             'linux/suid/sandbox.c',
149           ],
150           'cflags': [
151             # For ULLONG_MAX
152             '-std=gnu99',
153           ],
154           'include_dirs': [
155             '..',
156           ],
157         },
158         {
159           'target_name': 'sandbox',
160           'type': '<(library)',
161           'conditions': [
162             ['target_arch!="arm"', {
163                'dependencies': [
164                  '../seccompsandbox/seccomp.gyp:seccomp_sandbox',
165                ]},
166             ],
167           ],
168         },
169       ],
170     }],
171     [ 'OS=="linux" and (selinux==1 or clang==1)', {
172       # GYP requires that each file have at least one target defined.
173       'targets': [
174         {
175           'target_name': 'sandbox',
176           'type': 'settings',
177         },
178       ],
179     }],
180     [ 'OS=="win"', {
181       'targets': [
182         {
183           'target_name': 'sandbox',
184           'type': '<(library)',
185           'variables': {
186             'sandbox_windows_target': 1,
187           },
188           'dependencies': [
189             '../testing/gtest.gyp:gtest',
190             '../base/base.gyp:base',
191             '../base/base.gyp:base_static',
192           ],
193           'export_dependent_settings': [
194             '../base/base.gyp:base',
195           ],
196           'msvs_guid': '881F6A97-D539-4C48-B401-DF04385B2343',
197           'sources': [
198             # Files that are used by the 32-bit version of Windows sandbox only.
199             'src/resolver_32.cc',
200             'src/service_resolver_32.cc',
201             'src/sidestep_resolver.cc',
202             'src/sidestep_resolver.h',
203             'src/sidestep\ia32_modrm_map.cpp',
204             'src/sidestep\ia32_opcode_map.cpp',
205             'src/sidestep\mini_disassembler_types.h',
206             'src/sidestep\mini_disassembler.cpp',
207             'src/sidestep\mini_disassembler.h',
208             'src/sidestep\preamble_patcher_with_stub.cpp',
209             'src/sidestep\preamble_patcher.h',
210             'src/Wow64.cc',
211             'src/Wow64.h',
212           ],
213           'include_dirs': [
214             '..',
215           ],
216           'copies': [
217             {
218               'destination': '<(PRODUCT_DIR)',
219               'files': [
220                 'wow_helper/wow_helper.exe',
221                 'wow_helper/wow_helper.pdb',
222               ],
223             },
224           ],
225           'direct_dependent_settings': {
226             'include_dirs': [
227               'src',
228               '..',
229             ],
230           },
231         },
232         {
233           'target_name': 'sandbox_win64',
234           'type': '<(library)',
235           'variables': {
236             'sandbox_windows_target': 1,
237           },
238           'dependencies': [
239             '../testing/gtest.gyp:gtest',
240             '../base/base.gyp:base_nacl_win64',
241           ],
242           'configurations': {
243             'Common_Base': {
244               'msvs_target_platform': 'x64',
245             },
246           },
247           'msvs_guid': 'BE3468E6-B314-4310-B449-6FC0C52EE155',
248           'sources': [
249             # Files that are used by the 64-bit version of Windows sandbox only.
250             'src/interceptors_64.cc',
251             'src/interceptors_64.h',
252             'src/resolver_64.cc',
253             'src/service_resolver_64.cc',
254             'src/Wow64_64.cc',
255           ],
256           'include_dirs': [
257             '..',
258           ],
259           'direct_dependent_settings': {
260             'include_dirs': [
261               'src',
262               '..',
263             ],
264           },
265           'defines': [
266             '<@(nacl_win64_defines)',
267           ]
268         },
269         {
270           'target_name': 'sbox_integration_tests',
271           'type': 'executable',
272           'dependencies': [
273             'sandbox',
274             '../testing/gtest.gyp:gtest',
275           ],
276           'sources': [
277             'tests/common/controller.cc',
278             'tests/common/controller.h',
279             'tests/common/test_utils.cc',
280             'tests/common/test_utils.h',
281             'tests/integration_tests/integration_tests.cc',
282             'src/dep_test.cc',
283             'src/file_policy_test.cc',
284             'tests/integration_tests/integration_tests_test.cc',
285             'src/integrity_level_test.cc',
286             'src/ipc_ping_test.cc',
287             'src/named_pipe_policy_test.cc',
288             'src/policy_target_test.cc',
289             'src/process_policy_test.cc',
290             'src/registry_policy_test.cc',
291             'src/sync_policy_test.cc',
292             'src/unload_dll_test.cc',
293           ],
294         },
295         {
296           'target_name': 'sbox_validation_tests',
297           'type': 'executable',
298           'dependencies': [
299             'sandbox',
300             '../testing/gtest.gyp:gtest',
301           ],
302           'sources': [
303             'tests/common/controller.cc',
304             'tests/common/controller.h',
305             'tests/validation_tests/unit_tests.cc',
306             'tests/validation_tests/commands.cc',
307             'tests/validation_tests/commands.h',
308             'tests/validation_tests/suite.cc',
309           ],
310         },
311         {
312           'target_name': 'sbox_unittests',
313           'type': 'executable',
314           'dependencies': [
315             'sandbox',
316             '../testing/gtest.gyp:gtest',
317           ],
318           'sources': [
319             'tests/common/test_utils.cc',
320             'tests/common/test_utils.h',
321             'tests/unit_tests/unit_tests.cc',
322             'src/interception_unittest.cc',
323             'src/service_resolver_unittest.cc',
324             'src/restricted_token_unittest.cc',
325             'src/job_unittest.cc',
326             'src/sid_unittest.cc',
327             'src/policy_engine_unittest.cc',
328             'src/policy_low_level_unittest.cc',
329             'src/policy_opcodes_unittest.cc',
330             'src/ipc_unittest.cc',
331             'src/threadpool_unittest.cc',
332             'src/win_utils_unittest.cc',
333           ],
334         },
335         {
336           'target_name': 'sandbox_poc',
337           'type': 'executable',
338           'dependencies': [
339             'sandbox',
340             'pocdll',
341           ],
342           'sources': [
343             'sandbox_poc/main_ui_window.cc',
344             'sandbox_poc/main_ui_window.h',
345             'sandbox_poc/resource.h',
346             'sandbox_poc/sandbox.cc',
347             'sandbox_poc/sandbox.h',
348             'sandbox_poc/sandbox.ico',
349             'sandbox_poc/sandbox.rc',
350           ],
351           'link_settings': {
352             'libraries': [
353               '-lcomctl32.lib',
354             ],
355           },
356           'msvs_settings': {
357             'VCLinkerTool': {
358               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
359             },
360           },
361         },
362         {
363           'target_name': 'pocdll',
364           'type': 'shared_library',
365           'sources': [
366             'sandbox_poc/pocdll/exports.h',
367             'sandbox_poc/pocdll/fs.cc',
368             'sandbox_poc/pocdll/handles.cc',
369             'sandbox_poc/pocdll/invasive.cc',
370             'sandbox_poc/pocdll/network.cc',
371             'sandbox_poc/pocdll/pocdll.cc',
372             'sandbox_poc/pocdll/processes_and_threads.cc',
373             'sandbox_poc/pocdll/registry.cc',
374             'sandbox_poc/pocdll/spyware.cc',
375             'sandbox_poc/pocdll/utils.h',
376           ],
377           'defines': [
378             'POCDLL_EXPORTS',
379           ],
380           'include_dirs': [
381             '..',
382           ],
383         },
384       ],
385     }],
386   ],
389 # Local Variables:
390 # tab-width:2
391 # indent-tabs-mode:nil
392 # End:
393 # vim: set expandtab tabstop=2 shiftwidth=2: