Add GN build for parts of gpu and ozone.

Moves existing ozone platform flag to new .gni file with all ozone flags in it.

[email protected], [email protected], [email protected]

Review URL: https://codereview.chromium.org/285103002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270780 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
new file mode 100644
index 0000000..4e2d47a0
--- /dev/null
+++ b/gpu/BUILD.gn
@@ -0,0 +1,145 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+config("sizet_truncations") {
+  if (is_win) {
+    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+    cflags = [ "/wd4267" ]  # size_t to int truncation.
+  }
+}
+
+gles2_c_lib_source_files = [
+  "command_buffer/client/gles2_c_lib.cc",
+  "command_buffer/client/gles2_c_lib_autogen.h",
+  "command_buffer/client/gles2_c_lib_export.h",
+  "command_buffer/client/gles2_lib.h",
+  "command_buffer/client/gles2_lib.cc",
+]
+
+component("gles2_implementation") {
+  sources = [
+    "command_buffer/client/buffer_tracker.cc",
+    "command_buffer/client/buffer_tracker.h",
+    "command_buffer/client/client_context_state.h",
+    "command_buffer/client/client_context_state.cc",
+    "command_buffer/client/client_context_state_autogen.h",
+    "command_buffer/client/client_context_state_impl_autogen.h",
+    "command_buffer/client/gles2_impl_export.h",
+    "command_buffer/client/gles2_implementation_autogen.h",
+    "command_buffer/client/gles2_implementation.cc",
+    "command_buffer/client/gles2_implementation.h",
+    "command_buffer/client/gles2_implementation_impl_autogen.h",
+    "command_buffer/client/gles2_interface.h",
+    "command_buffer/client/gles2_trace_implementation_autogen.h",
+    "command_buffer/client/gles2_trace_implementation.cc",
+    "command_buffer/client/gles2_trace_implementation.h",
+    "command_buffer/client/gles2_trace_implementation_impl_autogen.h",
+    "command_buffer/client/gpu_memory_buffer_factory.h",
+    "command_buffer/client/gpu_memory_buffer_tracker.cc",
+    "command_buffer/client/gpu_memory_buffer_tracker.h",
+    "command_buffer/client/program_info_manager.cc",
+    "command_buffer/client/program_info_manager.h",
+    "command_buffer/client/query_tracker.cc",
+    "command_buffer/client/query_tracker.h",
+    "command_buffer/client/share_group.cc",
+    "command_buffer/client/share_group.h",
+    "command_buffer/client/vertex_array_object_manager.cc",
+    "command_buffer/client/vertex_array_object_manager.h",
+  ]
+  defines = [ "GLES2_IMPL_IMPLEMENTATION" ]
+  configs += [ ":sizet_truncations" ]
+  all_dependent_configs = [ "//third_party/khronos:khronos_headers" ]
+
+  deps = [
+    ":gles2_cmd_helper",
+    "//base",
+    "//gpu/command_buffer:gles2_utils",
+    "//ui/gfx/geometry",
+    "//ui/gl",
+  ]
+}
+
+component("gles2_c_lib") {
+  sources = gles2_c_lib_source_files
+  defines = [ "GLES2_C_LIB_IMPLEMENTATION" ]
+  configs += [ ":sizet_truncations" ]
+
+  deps = [
+    ":command_buffer_client",
+    ":gles2_implementation",
+    "//base",
+    "//base/third_party/dynamic_annotations",
+    "//gpu/command_buffer:gles2_utils",
+  ]
+}
+
+source_set("gles2_cmd_helper") {
+  sources = [
+    "command_buffer/client/gles2_cmd_helper.cc",
+    "command_buffer/client/gles2_cmd_helper.h",
+    "command_buffer/client/gles2_cmd_helper_autogen.h",
+  ]
+
+  configs += [ ":sizet_truncations" ]
+  deps = [ ":command_buffer_client" ]
+}
+
+source_set("command_buffer_client") {
+  sources = [
+    "command_buffer/client/cmd_buffer_helper.cc",
+    "command_buffer/client/cmd_buffer_helper.h",
+    "command_buffer/client/fenced_allocator.cc",
+    "command_buffer/client/fenced_allocator.h",
+    "command_buffer/client/gpu_control.h",
+    "command_buffer/client/mapped_memory.cc",
+    "command_buffer/client/mapped_memory.h",
+    "command_buffer/client/ring_buffer.cc",
+    "command_buffer/client/ring_buffer.h",
+    "command_buffer/client/transfer_buffer.cc",
+    "command_buffer/client/transfer_buffer.h",
+  ]
+
+  configs += [ ":sizet_truncations" ]
+  all_dependent_configs = [ "//third_party/khronos:khronos_headers" ]
+
+  deps = [
+    ":command_buffer_common",
+  ]
+}
+
+source_set("command_buffer_common") {
+  sources = [
+    "command_buffer/common/bitfield_helpers.h",
+    "command_buffer/common/buffer.cc",
+    "command_buffer/common/buffer.h",
+    "command_buffer/common/capabilities.cc",
+    "command_buffer/common/capabilities.h",
+    "command_buffer/common/cmd_buffer_common.cc",
+    "command_buffer/common/cmd_buffer_common.h",
+    "command_buffer/common/command_buffer.h",
+    "command_buffer/common/constants.h",
+    "command_buffer/common/debug_marker_manager.cc",
+    "command_buffer/common/debug_marker_manager.h",
+    "command_buffer/common/gles2_cmd_format.cc",
+    "command_buffer/common/gles2_cmd_format.h",
+    "command_buffer/common/gles2_cmd_format_autogen.h",
+    "command_buffer/common/gles2_cmd_ids.h",
+    "command_buffer/common/gles2_cmd_ids_autogen.h",
+    "command_buffer/common/id_allocator.cc",
+    "command_buffer/common/id_allocator.h",
+    "command_buffer/common/mailbox.cc",
+    "command_buffer/common/mailbox.h",
+    "command_buffer/common/mailbox_holder.cc",
+    "command_buffer/common/mailbox_holder.h",
+    "command_buffer/common/thread_local.h",
+    "command_buffer/common/time.h",
+  ]
+
+  all_dependent_configs = [ "//third_party/khronos:khronos_headers" ]
+
+  deps = [
+    "//base",
+    "//gpu/command_buffer:gles2_utils",
+  ]
+}