diff options
author | spang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-24 20:44:16 +0000 |
---|---|---|
committer | spang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-24 20:44:16 +0000 |
commit | 4c5e36be50f207a239195aba7ba3f036d7f3980b (patch) | |
tree | 7495d9c7f6c9947124d209f76a4a386080cbbe9a /ui/ozone | |
parent | bc335801071e5e07c2bb0f45992fb3a8f8010198 (diff) | |
download | chromium_src-4c5e36be50f207a239195aba7ba3f036d7f3980b.zip chromium_src-4c5e36be50f207a239195aba7ba3f036d7f3980b.tar.gz chromium_src-4c5e36be50f207a239195aba7ba3f036d7f3980b.tar.bz2 |
ozone: Fix GN build for ozone_egl_demo, ozone_unittests
This fixes the GN build for the ui/ozone component (and tests). The
following build should work going forward:
gn gen out_gn_ozone --args="use_ozone=true"
ninja -C out_gn_ozone -j1000 -k50 ozone_egl_demo ozone_unittests
BUG=396316
TEST=compile & run ozone_egl_demo, ozone_unittests
TBR=darin
Review URL: https://codereview.chromium.org/409163004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/ozone')
-rw-r--r-- | ui/ozone/BUILD.gn | 77 | ||||
-rw-r--r-- | ui/ozone/demo/BUILD.gn | 23 | ||||
-rw-r--r-- | ui/ozone/ozone.gni | 31 | ||||
-rw-r--r-- | ui/ozone/platform/caca/BUILD.gn | 34 | ||||
-rw-r--r-- | ui/ozone/platform/dri/BUILD.gn | 135 | ||||
-rw-r--r-- | ui/ozone/platform/egltest/BUILD.gn | 40 | ||||
-rw-r--r-- | ui/ozone/platform/test/BUILD.gn | 24 |
7 files changed, 337 insertions, 27 deletions
diff --git a/ui/ozone/BUILD.gn b/ui/ozone/BUILD.gn index b64ce6c..4d9144f 100644 --- a/ui/ozone/BUILD.gn +++ b/ui/ozone/BUILD.gn @@ -4,9 +4,39 @@ import("//ui/ozone/ozone.gni") -declare_args() { - # The default platform for Ozone. - ozone_platform = "test" +# The list of platforms that will be built. +ozone_platforms = [] + +# Extra dependencies to pull into ui/ozone for built platforms. +ozone_platform_deps = [] + +# Extra dependencies to pull into ozone_unittests for built platforms. +ozone_platform_test_deps = [] + +if (ozone_platform_egltest) { + ozone_platforms += [ "egltest" ] + ozone_platform_deps += [ "platform/egltest" ] +} + +if (ozone_platform_test) { + ozone_platforms += [ "test" ] + ozone_platform_deps += [ "platform/test" ] +} + +if (ozone_platform_caca) { + ozone_platforms += [ "caca" ] + ozone_platform_deps += [ "platform/caca" ] +} + +if (ozone_platform_dri) { + ozone_platforms += [ "dri" ] + ozone_platform_deps += [ "platform/dri" ] + ozone_platform_test_deps += [ "platform/dri:dri_unittests" ] +} + +if (ozone_platform_gbm) { + ozone_platforms += [ "gbm" ] + ozone_platform_deps += [ "platform/dri:gbm" ] } platform_list_cc_file = "$target_gen_dir/platform_list.cc" @@ -51,16 +81,25 @@ component("ozone") { # common/chromeos files are excluded automatically when building with # chromeos=0, by exclusion rules in filename_rules.gypi due to the # "chromeos" folder name. + "common/chromeos/display_mode_proxy.cc", + "common/chromeos/display_mode_proxy.h", + "common/chromeos/display_snapshot_proxy.cc", + "common/chromeos/display_snapshot_proxy.h", + "common/chromeos/display_util.cc", + "common/chromeos/display_util.h", "common/chromeos/native_display_delegate_ozone.cc", "common/chromeos/native_display_delegate_ozone.h", "common/chromeos/touchscreen_device_manager_ozone.cc", "common/chromeos/touchscreen_device_manager_ozone.h", "common/gpu/ozone_gpu_message_generator.cc", "common/gpu/ozone_gpu_message_generator.h", - "ozone_platform.cc", - "ozone_platform.h", - "ozone_switches.cc", - "ozone_switches.h", + "common/gpu/ozone_gpu_message_params.cc", + "common/gpu/ozone_gpu_message_params.h", + "common/gpu/ozone_gpu_messages.h", + "public/ozone_platform.cc", + "public/ozone_platform.h", + "public/ozone_switches.cc", + "public/ozone_switches.h", "platform_selection.cc", "platform_selection.h", ] @@ -81,18 +120,13 @@ component("ozone") { "//ui/gfx/ipc", # TODO(GYP) the GYP version has a way to add additional dependencies via # build flags. - ] + ] + ozone_platform_deps if (is_chromeos) { deps += [ "//ui/dusplay/types" ] } } -# TODO(GYP) implement the ozone platforms. This should check the various -# ozone_platform_*flags, and add deps and add to the ozone_platforms list for -# the script below. -ozone_platforms = "" - # GYP version: ui/ozone/ozone.gyp:generate_ozone_platform_list action("generate_ozone_platform_list") { script = "generate_ozone_platform_list.py" @@ -107,8 +141,7 @@ action("generate_ozone_platform_list") { "--output_h=" + rebase_path(platform_list_h_file, root_build_dir), "--output_txt=" + rebase_path(platform_list_txt_file, root_build_dir), "--default=$ozone_platform", - ozone_platforms, - ] + ] + ozone_platforms } # GYP version: ui/ozone/ozone.gyp:generate_constructor_list @@ -127,11 +160,19 @@ action("generate_constructor_list") { "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir), "--namespace=ui", "--typename=OzonePlatform", - "--include=ui/ozone/ozone_platform.h", + "--include=\"ui/ozone/public/ozone_platform.h\"", ] deps = [ ":generate_ozone_platform_list" ] } -# TODO(GYP) ozone_unittests -# TODO(GYP) platform_caca, dri, other test stuff. +test("ozone_unittests") { + sources = [ + "run_all_unittests.cc", + ] + + deps = [ + "//base/test:test_support", + "//testing/gtest", + ] + ozone_platform_test_deps +} diff --git a/ui/ozone/demo/BUILD.gn b/ui/ozone/demo/BUILD.gn new file mode 100644 index 0000000..c58431b --- /dev/null +++ b/ui/ozone/demo/BUILD.gn @@ -0,0 +1,23 @@ +# 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. + +group("demo") { + deps = [ + ":ozone_demo", + ] +} + +executable("ozone_demo") { + sources = [ + "ozone_demo.cc", + ] + + deps = [ + "//base", + "//skia", + "//ui/gfx/geometry", + "//ui/gl", + "//ui/ozone", + ] +} diff --git a/ui/ozone/ozone.gni b/ui/ozone/ozone.gni index a777f59..867813c 100644 --- a/ui/ozone/ozone.gni +++ b/ui/ozone/ozone.gni @@ -2,17 +2,30 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/ui.gni") +declare_args() { + # Select platforms automatically. Turn this off for manual control. + ozone_auto_platforms = true +} -if (use_ozone) { - # Enable built-in ozone platforms if ozone is enabled. - ozone_platform_caca = false - ozone_platform_dri = true - ozone_platform_ozonex = false - ozone_platform_test = true -} else { +declare_args() { + # The platform that will be active by default. + ozone_platform = "" + + # Enable individual platforms. ozone_platform_caca = false ozone_platform_dri = false - ozone_platform_ozonex = false + ozone_platform_egltest = false + ozone_platform_gbm = false ozone_platform_test = false + + if (ozone_auto_platforms) { + # Use test as the default platform. + ozone_platform = "test" + + # Build all platforms whose deps are in install-build-deps.sh. + # Only these platforms will be compile tested by buildbots. + ozone_platform_dri = true + ozone_platform_test = true + ozone_platform_egltest = true + } } diff --git a/ui/ozone/platform/caca/BUILD.gn b/ui/ozone/platform/caca/BUILD.gn new file mode 100644 index 0000000..079750f --- /dev/null +++ b/ui/ozone/platform/caca/BUILD.gn @@ -0,0 +1,34 @@ +# 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. + +import("//build/config/linux/pkg_config.gni") + +source_set("caca") { + sources = [ + "caca_event_factory.cc", + "caca_event_factory.h", + "caca_window.cc", + "caca_window.h", + "caca_window_manager.cc", + "caca_window_manager.h", + "ozone_platform_caca.cc", + "ozone_platform_caca.h", + "scoped_caca_types.cc", + "scoped_caca_types.h", + ] + + deps = [ + "//base", + "//skia", + "//ui/gfx/geometry", + ] + + configs += [ + ":libcaca", + ] +} + +pkg_config("libcaca") { + packages = [ "caca" ] +} diff --git a/ui/ozone/platform/dri/BUILD.gn b/ui/ozone/platform/dri/BUILD.gn new file mode 100644 index 0000000..f7d93d7 --- /dev/null +++ b/ui/ozone/platform/dri/BUILD.gn @@ -0,0 +1,135 @@ +# 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. + +import("//build/config/linux/pkg_config.gni") +import("//ui/ozone/ozone.gni") + +source_set("dri_common") { + sources = [ + "chromeos/display_mode_dri.cc", + "chromeos/display_mode_dri.h", + "chromeos/display_snapshot_dri.cc", + "chromeos/display_snapshot_dri.h", + "chromeos/native_display_delegate_dri.cc", + "chromeos/native_display_delegate_dri.h", + "cursor_factory_evdev_dri.cc", + "cursor_factory_evdev_dri.h", + "dri_console_buffer.cc", + "dri_console_buffer.h", + "dri_buffer.cc", + "dri_buffer.h", + "dri_surface.cc", + "dri_surface.h", + "dri_surface_factory.cc", + "dri_surface_factory.h", + "dri_util.cc", + "dri_util.h", + "dri_vsync_provider.cc", + "dri_vsync_provider.h", + "dri_window.cc", + "dri_window.h", + "dri_wrapper.cc", + "dri_wrapper.h", + "hardware_display_controller.cc", + "hardware_display_controller.h", + "scoped_drm_types.cc", + "scoped_drm_types.h", + "screen_manager.cc", + "screen_manager.h", + "scanout_buffer.h", + "virtual_terminal_manager.cc", + "virtual_terminal_manager.h", + ] + + deps = [ + "//base", + "//skia", + "//ipc", + "//ui/base", + "//ui/display/types", + "//ui/events", + "//ui/events/ozone:events_ozone_evdev", + "//ui/gfx", + "//ui/gfx/geometry", + ] + + direct_dependent_configs = [ + "//build/config/linux:libdrm", + ] +} + +if (ozone_platform_dri) { + source_set("dri") { + sources = [ + "ozone_platform_dri.cc", + "ozone_platform_dri.h", + ] + + deps = [ + ":dri_common", + "//base", + "//skia", + "//ui/events/ozone:events_ozone_evdev", + ] + } + + source_set("dri_unittests") { + sources = [ + "dri_surface_factory_unittest.cc", + "dri_surface_unittest.cc", + "hardware_display_controller_unittest.cc", + "screen_manager_unittest.cc", + "test/mock_dri_wrapper.cc", + "test/mock_dri_wrapper.h", + ] + + deps = [ + ":dri_common", + "//skia", + "//testing/gtest", + ] + } +} + +if (ozone_platform_gbm) { + pkg_config("libgbm") { + packages = [ "gbm" ] + } + + source_set("gbm") { + sources = [ + "chromeos/display_message_handler.cc", + "chromeos/display_message_handler.h", + "chromeos/native_display_delegate_proxy.cc", + "chromeos/native_display_delegate_proxy.h", + "gbm_buffer.cc", + "gbm_buffer.h", + "gbm_buffer_base.cc", + "gbm_buffer_base.h", + "gbm_surface.cc", + "gbm_surface.h", + "gbm_surfaceless.cc", + "gbm_surfaceless.h", + "gbm_surface_factory.cc", + "gbm_surface_factory.h", + "gpu_platform_support_gbm.cc", + "gpu_platform_support_gbm.h", + "gpu_platform_support_host_gbm.cc", + "gpu_platform_support_host_gbm.h", + "ozone_platform_gbm.cc", + "ozone_platform_gbm.h", + ] + + deps = [ + ":dri_common", + "//base", + "//skia", + "//ui/events/ozone:events_ozone_evdev", + ] + + direct_dependent_configs = [ + ":libgbm", + ] + } +} diff --git a/ui/ozone/platform/egltest/BUILD.gn b/ui/ozone/platform/egltest/BUILD.gn new file mode 100644 index 0000000..04cae36 --- /dev/null +++ b/ui/ozone/platform/egltest/BUILD.gn @@ -0,0 +1,40 @@ +# 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. + +import("//tools/generate_library_loader/generate_library_loader.gni") + +source_set("egltest") { + sources = [ + "ozone_platform_egltest.cc", + "ozone_platform_egltest.h", + ] + + deps = [ + ":eglplatform_shim", + "//base", + "//ui/events/ozone:events_ozone_evdev", + "//ui/gfx", + ] +} + +generate_library_loader("eglplatform_shim") { + name = "LibeglplatformShimLoader" + output_h = "libeglplatform_shim.h" + output_cc = "libeglplatform_shim_loader.cc" + header = "\"ui/ozone/platform/egltest/eglplatform_shim.h\"" + + functions = [ + "ShimQueryString", + "ShimInitialize", + "ShimTerminate", + "ShimCreateWindow", + "ShimQueryWindow", + "ShimDestroyWindow", + "ShimGetNativeDisplay", + "ShimGetNativeWindow", + "ShimReleaseNativeWindow", + ] +} + +# TODO(spang): eglplatform_shim_x11 once support lands: http://crbug.com/380327 diff --git a/ui/ozone/platform/test/BUILD.gn b/ui/ozone/platform/test/BUILD.gn new file mode 100644 index 0000000..11c6848 --- /dev/null +++ b/ui/ozone/platform/test/BUILD.gn @@ -0,0 +1,24 @@ +# 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. + +source_set("test") { + sources = [ + "ozone_platform_test.cc", + "ozone_platform_test.h", + "test_cursor_factory.cc", + "test_cursor_factory.h", + "test_window.cc", + "test_window.h", + "test_window_manager.cc", + "test_window_manager.h", + ] + + deps = [ + "//base", + "//skia", + "//ui/base", + "//ui/events/ozone:events_ozone_evdev", + "//ui/gfx/geometry", + ] +} |