Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/platform/glfw/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ declare_args() {
# but it can be enabled for supported platforms (Windows, macOS, and Linux)
# as an extra build artifact with this flag. The native toolkit shell will
# still be built as well.
build_glfw_shell = (is_linux || is_win) && current_toolchain == host_toolchain
build_glfw_shell = is_linux && current_toolchain == host_toolchain
}
7 changes: 5 additions & 2 deletions shell/platform/linux/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# found in the LICENSE file.

import("//build/config/linux/pkg_config.gni")
import("//flutter/shell/platform/glfw/config.gni")

pkg_config("x11") {
packages = [ "x11" ]
if (build_glfw_shell) {
pkg_config("x11") {
packages = [ "x11" ]
}
}

pkg_config("gtk") {
Expand Down
11 changes: 6 additions & 5 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ def to_gn_args(args):
gn_args['dart_platform_sdk'] = not args.full_dart_sdk
gn_args['full_dart_sdk'] = args.full_dart_sdk

if sys.platform == 'darwin':
if args.build_glfw_shell:
gn_args['build_glfw_shell'] = True
if args.build_glfw_shell is not None:
gn_args['build_glfw_shell'] = args.build_glfw_shell

gn_args['stripped_symbols'] = args.stripped

Expand Down Expand Up @@ -340,8 +339,10 @@ def parse_args(args):
help='The IDE files to generate using GN. Use `gn gen help` and look for the --ide flag to' +
' see supported IDEs. If this flag is not specified, a platform specific default is selected.')

parser.add_argument('--build-glfw-shell', dest='build_glfw_shell', default=False, action='store_true',
help='Force building the GLFW shell on desktop platforms where it is not built by default.')
parser.add_argument('--build-glfw-shell', action='store_const', const=True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought argparse implicitly added a no- flag variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm definitely not an argparse expert, but we're manually adding no- for stripped below already, and some quick searching turns up SO questions suggesting that it doesn't.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure either, but if this pattern has been followed before, thats fine by me (I did not notice it in the initial review).

help='Build the GLFW shell on supported platforms where it is not built by default.')
parser.add_argument('--no-build-glfw-shell', dest='build_glfw_shell', action='store_const', const=False,
help='Do not build the GLFW shell on platforms where it is built by default.')

parser.add_argument('--bitcode', default=False, action='store_true',
help='Enable bitcode for iOS targets. On debug runtime modes, this will be a marker only.')
Expand Down