From ee817fb84542865e253bcce1866bc13e4065ca4d Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 26 Mar 2019 14:31:36 -0400 Subject: [PATCH] Add GLFW (DEPS-based) to third_party (#225) GLFW is needed for the GLFW-based Windows and Linux desktop Flutter shells. --- build/secondary/third_party/glfw/BUILD.gn | 79 +++++++++++++++++++++++ build/secondary/third_party/glfw/README | 13 ++++ 2 files changed, 92 insertions(+) create mode 100644 build/secondary/third_party/glfw/BUILD.gn create mode 100644 build/secondary/third_party/glfw/README diff --git a/build/secondary/third_party/glfw/BUILD.gn b/build/secondary/third_party/glfw/BUILD.gn new file mode 100644 index 0000000000000..a24e5cd2cfc35 --- /dev/null +++ b/build/secondary/third_party/glfw/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +_checkout_dir = "//third_party/glfw" + +config("relative_glfw_headers") { + include_dirs = [ "$_checkout_dir/include" ] +} + +source_set("glfw") { + public = [ + "$_checkout_dir/include/GLFW/glfw3.h", + "$_checkout_dir/include/GLFW/glfw3native.h", + ] + + sources = [ + "$_checkout_dir/src/context.c", + "$_checkout_dir/src/init.c", + "$_checkout_dir/src/input.c", + "$_checkout_dir/src/monitor.c", + "$_checkout_dir/src/vulkan.c", + "$_checkout_dir/src/window.c", + ] + + include_dirs = [ + "$_checkout_dir/src", + ] + + public_configs = [ + ":relative_glfw_headers", + ] + + if (is_win) { + sources += [ + "$_checkout_dir/src/egl_context.c", + "$_checkout_dir/src/egl_context.h", + "$_checkout_dir/src/wgl_context.c", + "$_checkout_dir/src/wgl_context.h", + "$_checkout_dir/src/win32_init.c", + "$_checkout_dir/src/win32_joystick.c", + "$_checkout_dir/src/win32_joystick.h", + "$_checkout_dir/src/win32_monitor.c", + "$_checkout_dir/src/win32_platform.h", + "$_checkout_dir/src/win32_time.c", + "$_checkout_dir/src/win32_tls.c", + "$_checkout_dir/src/win32_window.c", + ] + + defines = [ "_GLFW_WIN32" ] + } else if (is_linux) { + sources += [ + "$_checkout_dir/src/egl_context.c", + "$_checkout_dir/src/egl_context.h", + "$_checkout_dir/src/glx_context.c", + "$_checkout_dir/src/glx_context.h", + "$_checkout_dir/src/linux_joystick.c", + "$_checkout_dir/src/linux_joystick.h", + "$_checkout_dir/src/posix_tls.c", + "$_checkout_dir/src/posix_tls.h", + "$_checkout_dir/src/posix_time.c", + "$_checkout_dir/src/posix_time.h", + "$_checkout_dir/src/x11_init.c", + "$_checkout_dir/src/x11_monitor.c", + "$_checkout_dir/src/x11_platform.h", + "$_checkout_dir/src/x11_window.c", + "$_checkout_dir/src/xkb_unicode.c", + "$_checkout_dir/src/xkb_unicode.h", + ] + + defines = [ + "_GLFW_X11", + "_GLFW_HAS_XF86VM", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + } +} diff --git a/build/secondary/third_party/glfw/README b/build/secondary/third_party/glfw/README new file mode 100644 index 0000000000000..404ef3cae2eec --- /dev/null +++ b/build/secondary/third_party/glfw/README @@ -0,0 +1,13 @@ +Name: GLFW +License: zlib/libpng (BSD-like) +Upstream Git: https://github.com/glfw/glfw +Version: 3.2.1 +Description: + +GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and +Vulkan development on the desktop. + +To update: +- Advance the pinned hash in DEPS, which should map the repository to + //third_party/glfw +- Update BUILD.gn if necessary for changes.