Update V8 to version 4.7.24.
[chromium-blink-merge.git] / gpu / BUILD.gn
blob5468fa154c99260b96cb02ce4577e39c03c2cc77
1 # Copyright 2014 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.
5 # GYP-to-GN project mappings:
7 #  gpu.gyp:command_buffer_client => //gpu/command_buffer/client
9 #  gpu.gyp:command_buffer_common => //gpu/command_buffer/common
11 #  gpu.gyp:command_buffer_service => //gpu/command_buffer/service
13 #  gpu/gpu.gyp:gl_in_process_context =>
14 #      //gpu/command_buffer/client:gl_in_process_context
16 #  gpu.gyp:gles2_cmd_helper => //gpu/command_buffer/client:gles2_cmd_helper
18 #  gpu.gyp:gles2_c_lib => //gpu/command_buffer/client:gles2_c_lib
20 #  gpu.gyp:gles2_implementation =>
21 #      //gpu/command_buffer/client:gles2_implementation
23 #  gpu.gyp:gpu_config => //gpu/config
25 #  gpu.gyp:gpu_ipc => //gpu/ipc
27 #  gpu.gyp:disk_cache_proto => //gpu/command_buffer/service:disk_cache_proto
29 #  command_buffer/command_buffer.gyp:gles2_utils =>
30 #     //gpu/command_buffer/common:gles2_utils
32 # gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings => //gpu/skia_bindings
34 import("//testing/test.gni")
35 import("//build/config/ui.gni")
37 config("gpu_implementation") {
38   defines = [ "GPU_IMPLEMENTATION" ]
41 component("gpu") {
42   public_deps = [
43     "//gpu/command_buffer/client:client_sources",
44     "//gpu/command_buffer/client:gles2_cmd_helper_sources",
45     "//gpu/command_buffer/common:common_sources",
46     "//gpu/command_buffer/service:service_sources",
47     "//gpu/config:config_sources",
48     "//gpu/ipc:ipc_sources",
49   ]
52 # GYP version: //gpu/gpu.gyp:command_buffer_gles2
53 shared_library("command_buffer_gles2") {
54   sources = [
55     # TODO(hendrikw): Move egl out of gles2_conform_support.
56     "gles2_conform_support/egl/config.cc",
57     "gles2_conform_support/egl/config.h",
58     "gles2_conform_support/egl/display.cc",
59     "gles2_conform_support/egl/display.h",
60     "gles2_conform_support/egl/egl.cc",
61     "gles2_conform_support/egl/surface.cc",
62     "gles2_conform_support/egl/surface.h",
63   ]
65   deps = [
66     "//base",
67     "//gpu/command_buffer/client:gles2_c_lib",
68     "//gpu/command_buffer/client:gles2_implementation",
69     "//gpu/command_buffer/service",
70     "//ui/gl:gl",
71   ]
73   if (!is_component_build) {
74     deps += [
75       "//gpu/command_buffer/client:client_sources",
76       "//gpu/command_buffer/client:gles2_cmd_helper_sources",
77     ]
78   }
80   defines = [ "EGLAPIENTRY=" ]
81   if (current_os == "win") {
82     defines += [ "EGLAPI=__declspec(dllexport)" ]
83   } else {
84     defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
85   }
88 source_set("test_support") {
89   testonly = true
90   sources = [
91     "command_buffer/client/gles2_interface_stub.cc",
92     "command_buffer/client/gles2_interface_stub.h",
93     "command_buffer/service/error_state_mock.cc",
94     "command_buffer/service/gles2_cmd_decoder_mock.cc",
95   ]
97   public_deps = [
98     ":gpu",
99     "//gpu/command_buffer/client:gles2_interface",
100   ]
101   deps = [
102     "//testing/gmock",
103     "//testing/gtest",
104     "//ui/gl:gl_unittest_utils",
105   ]
108 group("gl_tests_run") {
109   testonly = true
110   deps = [
111     ":gl_tests",
112   ]
115 test("gl_tests") {
116   sources = [
117     "command_buffer/tests/compressed_texture_test.cc",
118     "command_buffer/tests/gl_bind_uniform_location_unittest.cc",
119     "command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc",
120     "command_buffer/tests/gl_chromium_path_rendering_unittest.cc",
121     "command_buffer/tests/gl_clear_framebuffer_unittest.cc",
122     "command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc",
123     "command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc",
124     "command_buffer/tests/gl_cube_map_texture_unittest.cc",
125     "command_buffer/tests/gl_depth_texture_unittest.cc",
126     "command_buffer/tests/gl_gpu_memory_buffer_unittest.cc",
127     "command_buffer/tests/gl_lose_context_chromium_unittest.cc",
128     "command_buffer/tests/gl_manager.cc",
129     "command_buffer/tests/gl_manager.h",
130     "command_buffer/tests/gl_pointcoord_unittest.cc",
131     "command_buffer/tests/gl_program_unittest.cc",
132     "command_buffer/tests/gl_query_unittest.cc",
133     "command_buffer/tests/gl_readback_unittest.cc",
134     "command_buffer/tests/gl_shared_resources_unittest.cc",
135     "command_buffer/tests/gl_stream_draw_unittest.cc",
136     "command_buffer/tests/gl_test_utils.cc",
137     "command_buffer/tests/gl_test_utils.h",
138     "command_buffer/tests/gl_tests_main.cc",
139     "command_buffer/tests/gl_texture_mailbox_unittest.cc",
140     "command_buffer/tests/gl_texture_storage_unittest.cc",
141     "command_buffer/tests/gl_unittest.cc",
142     "command_buffer/tests/gl_unittests_android.cc",
143     "command_buffer/tests/gl_virtual_contexts_unittest.cc",
144     "command_buffer/tests/occlusion_query_unittest.cc",
145   ]
147   defines = [ "GL_GLEXT_PROTOTYPES" ]
149   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
151   deps = [
152     ":gpu",
153     ":test_support",
154     "//base",
155     "//base/test:test_support",
156     "//base/third_party/dynamic_annotations",
157     "//testing/gmock",
158     "//testing/gtest",
159     "//third_party/angle:translator",
160     "//ui/gfx",
161     "//ui/gfx:test_support",
162     "//ui/gfx/geometry",
163     "//ui/gl",
164     "//gpu/command_buffer/common:gles2_utils",
165     "//gpu/command_buffer/client:gles2_c_lib",
166     "//gpu/command_buffer/client:gles2_implementation",
167   ]
169   libs = []
171   if (is_android) {
172     deps += [ "//testing/android/native_test:native_test_native_code" ]
173     libs += [ "android" ]
174   }
177 # TODO(GYP): Delete this after we've converted everything to GN.
178 # The _run targets exist only for compatibility w/ GYP.
179 group("gpu_unittests_run") {
180   testonly = true
181   deps = [
182     ":gpu_unittests",
183   ]
186 test("gpu_unittests") {
187   sources = [
188     "command_buffer/client/buffer_tracker_unittest.cc",
189     "command_buffer/client/client_test_helper.cc",
190     "command_buffer/client/client_test_helper.h",
191     "command_buffer/client/cmd_buffer_helper_test.cc",
192     "command_buffer/client/fenced_allocator_test.cc",
193     "command_buffer/client/gles2_implementation_unittest.cc",
194     "command_buffer/client/mapped_memory_unittest.cc",
195     "command_buffer/client/program_info_manager_unittest.cc",
196     "command_buffer/client/query_tracker_unittest.cc",
197     "command_buffer/client/ring_buffer_test.cc",
198     "command_buffer/client/transfer_buffer_unittest.cc",
199     "command_buffer/client/vertex_array_object_manager_unittest.cc",
200     "command_buffer/common/bitfield_helpers_test.cc",
201     "command_buffer/common/command_buffer_mock.cc",
202     "command_buffer/common/command_buffer_mock.h",
203     "command_buffer/common/command_buffer_shared_test.cc",
204     "command_buffer/common/debug_marker_manager_unittest.cc",
205     "command_buffer/common/gles2_cmd_format_test.cc",
206     "command_buffer/common/gles2_cmd_format_test_autogen.h",
207     "command_buffer/common/gles2_cmd_utils_unittest.cc",
208     "command_buffer/common/id_allocator_test.cc",
209     "command_buffer/common/trace_event.h",
210     "command_buffer/common/unittest_main.cc",
211     "command_buffer/service/buffer_manager_unittest.cc",
212     "command_buffer/service/cmd_parser_test.cc",
213     "command_buffer/service/command_buffer_service_unittest.cc",
214     "command_buffer/service/common_decoder_unittest.cc",
215     "command_buffer/service/context_group_unittest.cc",
216     "command_buffer/service/context_state_unittest.cc",
217     "command_buffer/service/feature_info_unittest.cc",
218     "command_buffer/service/framebuffer_manager_unittest.cc",
219     "command_buffer/service/gl_context_mock.cc",
220     "command_buffer/service/gl_context_mock.h",
221     "command_buffer/service/gl_surface_mock.cc",
222     "command_buffer/service/gl_surface_mock.h",
223     "command_buffer/service/gles2_cmd_decoder_unittest.cc",
224     "command_buffer/service/gles2_cmd_decoder_unittest.h",
225     "command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h",
226     "command_buffer/service/gles2_cmd_decoder_unittest_1.cc",
227     "command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h",
228     "command_buffer/service/gles2_cmd_decoder_unittest_2.cc",
229     "command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h",
230     "command_buffer/service/gles2_cmd_decoder_unittest_3.cc",
231     "command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h",
232     "command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc",
233     "command_buffer/service/gles2_cmd_decoder_unittest_base.cc",
234     "command_buffer/service/gles2_cmd_decoder_unittest_base.h",
235     "command_buffer/service/gles2_cmd_decoder_unittest_buffers.cc",
236     "command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc",
237     "command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc",
238     "command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc",
239     "command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc",
240     "command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc",
241     "command_buffer/service/gles2_cmd_decoder_unittest_programs.cc",
242     "command_buffer/service/gles2_cmd_decoder_unittest_textures.cc",
243     "command_buffer/service/gles2_cmd_decoder_unittest_valuebuffer.cc",
244     "command_buffer/service/gpu_scheduler_unittest.cc",
245     "command_buffer/service/gpu_service_test.cc",
246     "command_buffer/service/gpu_service_test.h",
247     "command_buffer/service/gpu_tracer_unittest.cc",
248     "command_buffer/service/id_manager_unittest.cc",
249     "command_buffer/service/mailbox_manager_unittest.cc",
250     "command_buffer/service/memory_program_cache_unittest.cc",
251     "command_buffer/service/mocks.cc",
252     "command_buffer/service/mocks.h",
253     "command_buffer/service/path_manager_unittest.cc",
254     "command_buffer/service/program_cache_unittest.cc",
255     "command_buffer/service/program_manager_unittest.cc",
256     "command_buffer/service/query_manager_unittest.cc",
257     "command_buffer/service/renderbuffer_manager_unittest.cc",
258     "command_buffer/service/shader_manager_unittest.cc",
259     "command_buffer/service/shader_translator_cache_unittest.cc",
260     "command_buffer/service/shader_translator_unittest.cc",
261     "command_buffer/service/test_helper.cc",
262     "command_buffer/service/test_helper.h",
263     "command_buffer/service/texture_manager_unittest.cc",
264     "command_buffer/service/transfer_buffer_manager_unittest.cc",
265     "command_buffer/service/valuebuffer_manager_unittest.cc",
266     "command_buffer/service/vertex_array_manager_unittest.cc",
267     "command_buffer/service/vertex_attrib_manager_unittest.cc",
268     "config/gpu_blacklist_unittest.cc",
269     "config/gpu_control_list_entry_unittest.cc",
270     "config/gpu_control_list_number_info_unittest.cc",
271     "config/gpu_control_list_os_info_unittest.cc",
272     "config/gpu_control_list_unittest.cc",
273     "config/gpu_control_list_version_info_unittest.cc",
274     "config/gpu_driver_bug_list_unittest.cc",
275     "config/gpu_info_collector_unittest.cc",
276     "config/gpu_info_unittest.cc",
277     "config/gpu_test_config_unittest.cc",
278     "config/gpu_test_expectations_parser_unittest.cc",
279     "config/gpu_util_unittest.cc",
280   ]
282   configs += [
283     "//build/config:precompiled_headers",
285     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
286     "//build/config/compiler:no_size_t_to_int_warning",
287   ]
289   deps = [
290     ":gpu",
291     ":test_support",
292     "//base",
293     "//base/test:test_support",
294     "//base/third_party/dynamic_annotations",
295     "//testing/gmock",
296     "//testing/gtest",
297     "//third_party/angle:translator",
298     "//ui/gfx",
299     "//ui/gfx/geometry",
300     "//ui/gfx:test_support",
301     "//ui/gl",
302     "//ui/gl:gl_unittest_utils",
303     "//ui/gl:test_support",
304     "//gpu/command_buffer/common:gles2_utils",
305     "//gpu/command_buffer/client:gles2_c_lib",
306     "//gpu/command_buffer/client:gles2_implementation",
307   ]
310 test("gpu_perftests") {
311   sources = [
312     "perftests/measurements.cc",
313     "perftests/run_all_tests.cc",
314     "perftests/texture_upload_perftest.cc",
315   ]
317   deps = [
318     "//base",
319     "//base/test:test_support",
320     "//gpu/command_buffer/service",
321     "//testing/gmock",
322     "//testing/gtest",
323     "//testing/perf",
324     "//ui/gfx/geometry",
325     "//ui/gl",
326   ]
329 # TODO(GYP): Delete this after we've converted everything to GN.
330 # The _run targets exist only for compatibility w/ GYP.
331 group("angle_unittests_run") {
332   testonly = true
333   deps = [
334     ":angle_unittests",
335   ]
338 test("angle_unittests") {
339   sources = [
340     "angle_unittest_main.cc",
341   ]
343   deps = [
344     "//base",
345     "//base/test:test_support",
346     "//base/third_party/dynamic_annotations",
347     "//testing/gmock",
348     "//testing/gtest",
349     "//third_party/angle:translator_static",
350   ]
354 # TODO(GYP): Delete this after we've converted everything to GN.
355 # The _run targets exist only for compatibility w/ GYP.
356 group("angle_end2end_tests_run") {
357   testonly = true
358   deps = [
359     ":angle_end2end_tests",
360   ]
363 test("angle_end2end_tests") {
364   sources = [
365     # TODO(crbug.com/519778): Use this instead when angle actually works.
366     # For now, this creates an empty stub binary that will at least
367     # run properly on the bots.
368     # "angle_end2end_tests_main.cc",
369     "//base/test/run_all_unittests.cc",
370   ]
372   deps = [
373     "//base/test:test_support",
374     "//testing/gmock",
375     "//testing/gtest",
377     # TODO(crbug.com/519778): This needs to be implemented.
378     # "//third_party/angle:end_to_end_tests",
379   ]