Skip to content

Commit c10ae2b

Browse files
authored
Add an option to build the GLFW shell on macOS (#8531)
Since the GLFW shell is likely to continue to exist in at least the medium term, it is useful for maintenance to be able to build and use it on any desktop platform. Includes a buildroot roll to pick up the macOS build suppport for third_party/glfw.
1 parent 29aa5fc commit c10ae2b

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ allowed_hosts = [
120120
]
121121

122122
deps = {
123-
'src': 'https://github.com/flutter/buildroot.git' + '@' + '5311c632822d0d2d4e4cf8cba3053cde5183c89c',
123+
'src': 'https://github.com/flutter/buildroot.git' + '@' + '94695026d9a1d8963089a470eef26470312c5b00',
124124

125125
# Fuchsia compatibility
126126
#

shell/platform/darwin/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ group("darwin") {
1414
}
1515
if (is_mac) {
1616
deps = [
17-
"macos:flutter_framework",
17+
"macos",
1818
]
1919
}
2020
}

shell/platform/darwin/macos/BUILD.gn

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ assert(is_mac)
77
import("//build/config/mac/mac_sdk.gni")
88
import("$flutter_root/common/config.gni")
99
import("$flutter_root/shell/platform/darwin/framework_shared.gni")
10+
import("$flutter_root/shell/platform/glfw/config.gni")
11+
12+
group("macos") {
13+
deps = [
14+
":flutter_framework",
15+
]
16+
if (build_glfw_shell) {
17+
deps += [
18+
":flutter_macos_glfw",
19+
"$flutter_root/shell/platform/common/cpp/client_wrapper:publish_wrapper",
20+
"$flutter_root/shell/platform/glfw:publish_headers_glfw",
21+
"$flutter_root/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
22+
]
23+
}
24+
}
1025

1126
_flutter_framework_name = "FlutterMacOS"
1227
_flutter_framework_filename = "$_flutter_framework_name.framework"
@@ -194,3 +209,13 @@ group("flutter_framework") {
194209
":_generate_symlinks",
195210
]
196211
}
212+
213+
if (build_glfw_shell) {
214+
shared_library("flutter_macos_glfw") {
215+
deps = [
216+
"$flutter_root/shell/platform/glfw:flutter_glfw",
217+
]
218+
219+
public_configs = [ "$flutter_root:config" ]
220+
}
221+
}

shell/platform/glfw/config.gni

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2013 The Flutter 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.
4+
5+
declare_args() {
6+
# Whether to build the GLFW shell for the host platform, if available.
7+
#
8+
# By default, the GLFW shell is not built if there is a native toolkit shell,
9+
# but it can be enabled for supported platforms (Windows, macOS, and Linux)
10+
# as an extra build artifact with this flag. The native toolkit shell will
11+
# still be built as well.
12+
build_glfw_shell = is_linux || is_win
13+
}

0 commit comments

Comments
 (0)