Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / sandbox / win / sandbox_win.gypi
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   'target_defaults': {
7     'variables': {
8       'sandbox_windows_target': 0,
9       'target_arch%': 'ia32',
10     },
11     'target_conditions': [
12       ['sandbox_windows_target==1', {
13         # Files that are shared between the 32-bit and the 64-bit versions
14         # of the Windows sandbox library.
15         'sources': [
16             'src/acl.cc',
17             'src/acl.h',
18             'src/app_container.cc',
19             'src/app_container.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/eat_resolver.cc',
27             'src/eat_resolver.h',
28             'src/filesystem_dispatcher.cc',
29             'src/filesystem_dispatcher.h',
30             'src/filesystem_interception.cc',
31             'src/filesystem_interception.h',
32             'src/filesystem_policy.cc',
33             'src/filesystem_policy.h',
34             'src/handle_closer.cc',
35             'src/handle_closer.h',
36             'src/handle_closer_agent.cc',
37             'src/handle_closer_agent.h',
38             'src/handle_dispatcher.cc',
39             'src/handle_dispatcher.h',
40             'src/handle_interception.cc',
41             'src/handle_interception.h',
42             'src/handle_policy.cc',
43             'src/handle_policy.h',
44             'src/handle_table.cc',
45             'src/handle_table.h',
46             'src/interception.cc',
47             'src/interception.h',
48             'src/interception_agent.cc',
49             'src/interception_agent.h',
50             'src/interception_internal.h',
51             'src/interceptors.h',
52             'src/internal_types.h',
53             'src/ipc_tags.h',
54             'src/job.cc',
55             'src/job.h',
56             'src/named_pipe_dispatcher.cc',
57             'src/named_pipe_dispatcher.h',
58             'src/named_pipe_interception.cc',
59             'src/named_pipe_interception.h',
60             'src/named_pipe_policy.cc',
61             'src/named_pipe_policy.h',
62             'src/nt_internals.h',
63             'src/policy_broker.cc',
64             'src/policy_broker.h',
65             'src/policy_engine_opcodes.cc',
66             'src/policy_engine_opcodes.h',
67             'src/policy_engine_params.h',
68             'src/policy_engine_processor.cc',
69             'src/policy_engine_processor.h',
70             'src/policy_low_level.cc',
71             'src/policy_low_level.h',
72             'src/policy_params.h',
73             'src/policy_target.cc',
74             'src/policy_target.h',
75             'src/process_mitigations.cc',
76             'src/process_mitigations.h',
77             'src/process_thread_dispatcher.cc',
78             'src/process_thread_dispatcher.h',
79             'src/process_thread_interception.cc',
80             'src/process_thread_interception.h',
81             'src/process_thread_policy.cc',
82             'src/process_thread_policy.h',
83             'src/registry_dispatcher.cc',
84             'src/registry_dispatcher.h',
85             'src/registry_interception.cc',
86             'src/registry_interception.h',
87             'src/registry_policy.cc',
88             'src/registry_policy.h',
89             'src/resolver.cc',
90             'src/resolver.h',
91             'src/restricted_token_utils.cc',
92             'src/restricted_token_utils.h',
93             'src/restricted_token.cc',
94             'src/restricted_token.h',
95             'src/sandbox_factory.h',
96             'src/sandbox_globals.cc',
97             'src/sandbox_nt_types.h',
98             'src/sandbox_nt_util.cc',
99             'src/sandbox_nt_util.h',
100             'src/sandbox_policy_base.cc',
101             'src/sandbox_policy_base.h',
102             'src/sandbox_policy.h',
103             'src/sandbox_types.h',
104             'src/sandbox_utils.cc',
105             'src/sandbox_utils.h',
106             'src/sandbox.cc',
107             'src/sandbox.h',
108             'src/security_level.h',
109             'src/service_resolver.cc',
110             'src/service_resolver.h',
111             'src/shared_handles.cc',
112             'src/shared_handles.h',
113             'src/sharedmem_ipc_client.cc',
114             'src/sharedmem_ipc_client.h',
115             'src/sharedmem_ipc_server.cc',
116             'src/sharedmem_ipc_server.h',
117             'src/sid.cc',
118             'src/sid.h',
119             'src/sync_dispatcher.cc',
120             'src/sync_dispatcher.h',
121             'src/sync_interception.cc',
122             'src/sync_interception.h',
123             'src/sync_policy.cc',
124             'src/sync_policy.h',
125             'src/target_interceptions.cc',
126             'src/target_interceptions.h',
127             'src/target_process.cc',
128             'src/target_process.h',
129             'src/target_services.cc',
130             'src/target_services.h',
131             'src/win_utils.cc',
132             'src/win_utils.h',
133             'src/win2k_threadpool.cc',
134             'src/win2k_threadpool.h',
135             'src/window.cc',
136             'src/window.h',
137         ],
138         'target_conditions': [
139           ['target_arch=="x64"', {
140             'sources': [
141               'src/interceptors_64.cc',
142               'src/interceptors_64.h',
143               'src/resolver_64.cc',
144               'src/service_resolver_64.cc',
145               'src/Wow64_64.cc',
146             ],
147           }],
148           ['target_arch=="ia32"', {
149             'sources': [
150               'src/resolver_32.cc',
151               'src/service_resolver_32.cc',
152               'src/sidestep_resolver.cc',
153               'src/sidestep_resolver.h',
154               'src/sidestep\ia32_modrm_map.cpp',
155               'src/sidestep\ia32_opcode_map.cpp',
156               'src/sidestep\mini_disassembler_types.h',
157               'src/sidestep\mini_disassembler.cpp',
158               'src/sidestep\mini_disassembler.h',
159               'src/sidestep\preamble_patcher_with_stub.cpp',
160               'src/sidestep\preamble_patcher.h',
161               'src/Wow64.cc',
162               'src/Wow64.h',
163             ],
164           }],
165         ],
166       }],
167     ],
168   },
169   'targets': [
170     {
171       'target_name': 'sandbox',
172       'type': 'static_library',
173       'variables': {
174         'sandbox_windows_target': 1,
175       },
176       'dependencies': [
177         '../base/base.gyp:base',
178         '../base/base.gyp:base_static',
179       ],
180       'export_dependent_settings': [
181         '../base/base.gyp:base',
182       ],
183       'include_dirs': [
184         '../..',
185       ],
186       'direct_dependent_settings': {
187         'include_dirs': [
188           'src',
189           '../..',
190         ],
191       },
192       'target_conditions': [
193         ['target_arch=="ia32"', {
194           'copies': [
195             {
196               'destination': '<(PRODUCT_DIR)',
197               'files': [
198                 'wow_helper/wow_helper.exe',
199                 'wow_helper/wow_helper.pdb',
200               ],
201             },
202           ],
203         }],
204       ],
205     },
206     {
207       'target_name': 'sbox_integration_tests',
208       'type': 'executable',
209       'dependencies': [
210         'sandbox',
211         '../testing/gtest.gyp:gtest',
212       ],
213       'sources': [
214         'src/app_container_test.cc',
215         'src/file_policy_test.cc',
216         'src/handle_inheritance_test.cc',
217         'src/handle_policy_test.cc',
218         'tests/integration_tests/integration_tests_test.cc',
219         'src/handle_closer_test.cc',
220         'src/integrity_level_test.cc',
221         'src/ipc_ping_test.cc',
222         'src/named_pipe_policy_test.cc',
223         'src/policy_target_test.cc',
224         'src/process_mitigations_test.cc',
225         'src/process_policy_test.cc',
226         'src/registry_policy_test.cc',
227         'src/sync_policy_test.cc',
228         'src/sync_policy_test.h',
229         'src/unload_dll_test.cc',
230         'tests/common/controller.cc',
231         'tests/common/controller.h',
232         'tests/common/test_utils.cc',
233         'tests/common/test_utils.h',
234         'tests/integration_tests/integration_tests.cc',
235       ],
236     },
237     {
238       'target_name': 'sbox_validation_tests',
239       'type': 'executable',
240       'dependencies': [
241         'sandbox',
242         '../testing/gtest.gyp:gtest',
243       ],
244       'sources': [
245         'tests/common/controller.cc',
246         'tests/common/controller.h',
247         'tests/validation_tests/unit_tests.cc',
248         'tests/validation_tests/commands.cc',
249         'tests/validation_tests/commands.h',
250         'tests/validation_tests/suite.cc',
251       ],
252     },
253     {
254       'target_name': 'sbox_unittests',
255       'type': 'executable',
256       'dependencies': [
257         'sandbox',
258         '../testing/gtest.gyp:gtest',
259       ],
260       'sources': [
261         'src/app_container_unittest.cc',
262         'src/interception_unittest.cc',
263         'src/service_resolver_unittest.cc',
264         'src/restricted_token_unittest.cc',
265         'src/job_unittest.cc',
266         'src/sid_unittest.cc',
267         'src/policy_engine_unittest.cc',
268         'src/policy_low_level_unittest.cc',
269         'src/policy_opcodes_unittest.cc',
270         'src/ipc_unittest.cc',
271         'src/threadpool_unittest.cc',
272         'src/win_utils_unittest.cc',
273         'tests/common/test_utils.cc',
274         'tests/common/test_utils.h',
275         'tests/unit_tests/unit_tests.cc',
276       ],
277     },
278     {
279       'target_name': 'sandbox_poc',
280       'type': 'executable',
281       'dependencies': [
282         'sandbox',
283         'pocdll',
284       ],
285       'sources': [
286         'sandbox_poc/main_ui_window.cc',
287         'sandbox_poc/main_ui_window.h',
288         'sandbox_poc/resource.h',
289         'sandbox_poc/sandbox.cc',
290         'sandbox_poc/sandbox.h',
291         'sandbox_poc/sandbox.ico',
292         'sandbox_poc/sandbox.rc',
293       ],
294       'link_settings': {
295         'libraries': [
296           '-lcomctl32.lib',
297         ],
298       },
299       'msvs_settings': {
300         'VCLinkerTool': {
301           'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
302         },
303       },
304     },
305     {
306       'target_name': 'pocdll',
307       'type': 'shared_library',
308       'sources': [
309         'sandbox_poc/pocdll/exports.h',
310         'sandbox_poc/pocdll/fs.cc',
311         'sandbox_poc/pocdll/handles.cc',
312         'sandbox_poc/pocdll/invasive.cc',
313         'sandbox_poc/pocdll/network.cc',
314         'sandbox_poc/pocdll/pocdll.cc',
315         'sandbox_poc/pocdll/processes_and_threads.cc',
316         'sandbox_poc/pocdll/registry.cc',
317         'sandbox_poc/pocdll/spyware.cc',
318         'sandbox_poc/pocdll/utils.h',
319       ],
320       'defines': [
321         'POCDLL_EXPORTS',
322       ],
323       'include_dirs': [
324         '../..',
325       ],
326     },
327   ],
328   'conditions': [
329     ['OS=="win" and target_arch=="ia32"', {
330       'targets': [
331         {
332           'target_name': 'sandbox_win64',
333           'type': 'static_library',
334           'variables': {
335             'sandbox_windows_target': 1,
336             'target_arch': 'x64',
337           },
338           'dependencies': [
339             '../base/base.gyp:base_win64',
340             '../base/base.gyp:base_static_win64',
341           ],
342           'configurations': {
343             'Common_Base': {
344               'msvs_target_platform': 'x64',
345             },
346           },
347           'include_dirs': [
348             '../..',
349           ],
350           'direct_dependent_settings': {
351             'include_dirs': [
352               'src',
353               '../..',
354             ],
355           },
356           'defines': [
357             '<@(nacl_win64_defines)',
358           ]
359         },
360       ],
361     }],
362   ],
363 }