Skip to content

Commit

Permalink
Add GLFW (DEPS-based) to third_party (#225)
Browse files Browse the repository at this point in the history
GLFW is needed for the GLFW-based Windows and Linux desktop Flutter
shells.
  • Loading branch information
stuartmorgan authored Mar 26, 2019
1 parent 9c7b023 commit ee817fb
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
79 changes: 79 additions & 0 deletions build/secondary/third_party/glfw/BUILD.gn
Original file line number Diff line number Diff line change
@@ -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" ]
}
}
13 changes: 13 additions & 0 deletions build/secondary/third_party/glfw/README
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit ee817fb

Please sign in to comment.