When enabling new profile management programmatically, make sure to set the
[chromium-blink-merge.git] / ui / ozone / ozone.gyp
blob5a42e7cdd7d868eaf2a031db9051023de2165cc4
1 # Copyright 2013 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     'external_ozone_platforms': [],
9     'external_ozone_platform_files': [],
10     'external_ozone_platform_deps': [],
11     'external_ozone_platform_unittest_deps': [],
12     'internal_ozone_platforms': [],
13     'internal_ozone_platform_deps': [],
14     'internal_ozone_platform_unittest_deps': [],
15   },
16   'targets': [
17     {
18       'target_name': 'ozone_base',
19       'type': '<(component)',
20       'dependencies': [
21         '<(DEPTH)/base/base.gyp:base',
22         '<(DEPTH)/skia/skia.gyp:skia',
23         '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
24       ],
25       'defines': [
26         'OZONE_BASE_IMPLEMENTATION',
27       ],
28       'sources': [
29         'public/cursor_factory_ozone.cc',
30         'public/cursor_factory_ozone.h',
31         'public/event_factory_ozone.cc',
32         'public/event_factory_ozone.h',
33         'public/overlay_candidates_ozone.cc',
34         'public/overlay_candidates_ozone.h',
35         'public/surface_factory_ozone.cc',
36         'public/surface_factory_ozone.h',
37         'public/surface_ozone_canvas.h',
38         'public/surface_ozone_egl.h',
39       ],
40     },
41     {
42       'target_name': 'ozone',
43       'type': '<(component)',
44       'dependencies': [
45         '<(DEPTH)/base/base.gyp:base',
46         '<(DEPTH)/ui/events/events.gyp:events',
47         '<(DEPTH)/ui/events/ozone/events_ozone.gyp:events_ozone',
48         '<(DEPTH)/ui/gfx/gfx.gyp:gfx',
49         '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
50         '<(DEPTH)/skia/skia.gyp:skia',
51         '<@(external_ozone_platform_deps)',
52         '<@(internal_ozone_platform_deps)',
53         'ozone_base',
54       ],
55       'defines': [
56         'OZONE_IMPLEMENTATION',
57       ],
58       'variables': {
59         'platform_list_cc_file': '<(INTERMEDIATE_DIR)/ui/ozone/platform_list.cc',
60         'platform_list_h_file': '<(SHARED_INTERMEDIATE_DIR)/ui/ozone/platform_list.h',
61         'platform_list_txt_file': '<(SHARED_INTERMEDIATE_DIR)/ui/ozone/platform_list.txt',
62         'constructor_list_cc_file': '<(INTERMEDIATE_DIR)/ui/ozone/constructor_list.cc',
63         'ozone_platforms': [
64           '<@(external_ozone_platforms)',
65           '<@(internal_ozone_platforms)',
66         ],
67       },
68       'include_dirs': [
69         '<(SHARED_INTERMEDIATE_DIR)',
70       ],
71       'sources': [
72         '<(platform_list_cc_file)',
73         '<(platform_list_h_file)',
74         '<(constructor_list_cc_file)',
76         # common/chromeos files are excluded automatically when building with
77         # chromeos=0, by exclusion rules in filename_rules.gypi due to the
78         # 'chromeos' folder name.
79         'common/chromeos/native_display_delegate_ozone.cc',
80         'common/chromeos/native_display_delegate_ozone.h',
81         'common/chromeos/touchscreen_device_manager_ozone.cc',
82         'common/chromeos/touchscreen_device_manager_ozone.h',
83         'ozone_platform.cc',
84         'ozone_platform.h',
85         'ozone_switches.cc',
86         'ozone_switches.h',
87         'platform_selection.cc',
88         'platform_selection.h',
89         '<@(external_ozone_platform_files)',
90       ],
91       'actions': [
92         {
93           'action_name': 'generate_ozone_platform_list',
94           'variables': {
95             'generator_path': 'generate_ozone_platform_list.py',
96           },
97           'inputs': [
98             '<(generator_path)',
99           ],
100           'outputs': [
101             '<(platform_list_cc_file)',
102             '<(platform_list_h_file)',
103             '<(platform_list_txt_file)',
104           ],
105           'action': [
106             'python',
107             '<(generator_path)',
108             '--output_cc=<(platform_list_cc_file)',
109             '--output_h=<(platform_list_h_file)',
110             '--output_txt=<(platform_list_txt_file)',
111             '--default=<(ozone_platform)',
112             '<@(ozone_platforms)',
113           ],
114         },
115         {
116           'action_name': 'generate_constructor_list',
117           'variables': {
118             'generator_path': 'generate_constructor_list.py',
119           },
120           'inputs': [
121             '<(generator_path)',
122             '<(platform_list_txt_file)',
123           ],
124           'outputs': [
125             '<(constructor_list_cc_file)',
126           ],
127           'action': [
128             'python',
129             '<(generator_path)',
130             '--platform_list=<(platform_list_txt_file)',
131             '--output_cc=<(constructor_list_cc_file)',
132             '--namespace=ui',
133             '--typename=OzonePlatform',
134             '--include="ui/ozone/ozone_platform.h"'
135           ],
136         },
137       ],
138       'conditions': [
139         ['use_udev == 0', {
140           'sources/': [
141             ['exclude', '_udev\\.(h|cc)$'],
142           ],
143         }],
144         ['chromeos==1', {
145           'dependencies': [
146             '<(DEPTH)/ui/display/display.gyp:display_types',
147           ],
148         }],
149       ],
150     },
151     {
152       'target_name': 'ozone_unittests',
153       'type': '<(gtest_target_type)',
154       'sources': [
155         'run_all_unittests.cc',
156       ],
157       'dependencies': [
158         'ozone',
159         'ozone_base',
160         '../../base/base.gyp:base',
161         '../../base/base.gyp:test_support_base',
162         '../../testing/gtest.gyp:gtest',
163         '<@(external_ozone_platform_unittest_deps)',
164         '<@(internal_ozone_platform_unittest_deps)',
165       ],
166     },
167   ],
168   'conditions': [
169     ['<(ozone_platform_caca) == 1', {
170       'includes': [
171         'platform/caca/caca.gypi',
172       ],
173     }],
174     ['<(ozone_platform_dri) == 1 or <(ozone_platform_gbm) == 1', {
175       'includes': [
176         'platform/dri/dri.gypi',
177       ],
178     }],
179     ['<(ozone_platform_egltest) == 1', {
180       'includes': [
181         'platform/egltest/egltest.gypi',
182       ],
183     }],
184     ['<(ozone_platform_gbm) == 1', {
185       'includes': [
186         'platform/dri/gbm.gypi',
187       ],
188     }],
189     ['<(ozone_platform_test) == 1', {
190       'includes': [
191         'platform/test/test.gypi',
192       ],
193     }],
194   ],