[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate build_overrides from buildroot to engine #51258

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Migrate build_overrides from buildroot to engine
Files under the build_overrides directory in the buildroot are typically
hardcoded imports in third-party dependencies used for project-specific
configuration. For example, ANGLE hardcodes an import of
`//build_overrides/angle.gni` so that consumers of ANGLE can configure
the build to their needs.

This adds a copy all existing src/build_overrides files at the
equivalent `src/flutter/build_overrides` path in the engine. A followup
patch will replace each existing file under `src/build_overrides` in the
buildroot with a shim that just imports the files landed in this patch.
This allows the upstream project to continue hardcoding the
`//build_overrides/foo.gni` path, but provides a seamless path forward
when we drop the buildroot.

Adds flutter/build_overrides as an excluded path for the licence script.

Issue: flutter/flutter#144790
Part of: flutter/flutter#67373
  • Loading branch information
cbracken committed Mar 7, 2024
commit 5fa9f0805987b999ed53526dd0d20852d14d40b8
38 changes: 38 additions & 0 deletions build_overrides/angle.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2019 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.

# Ensure use_xcode_clang is visibile to ANGLE.
import("//build/toolchain/toolchain.gni")

# The ANGLE build requires this file to point to the location of third-party
# dependencies.
angle_root = "//third_party/angle"

angle_vma_version = 30000001

# Flutter's buildroot looks enough like Chromium to satisfy Angle, and enough
# to cause GN variable collisions if we don't set this.
if (!is_fuchsia) {
angle_has_build = true
}

# Overrides for ANGLE's dependencies.
angle_abseil_cpp_dir = "//flutter/third_party/abseil-cpp"
angle_glslang_dir = "//flutter/third_party/vulkan-deps/glslang/src"
angle_googletest_dir = "//third_party/googletest/googletest/src"

# Note: This path doesn't actually exist; see
# //build/secondary/third_party/jsoncpp/BUILD.gn
angle_jsoncpp_dir = "//third_party/jsoncpp"
angle_libjpeg_turbo_dir = "//third_party/libjpeg_turbo"
angle_libpng_dir = "//flutter/third_party/libpng"
angle_spirv_headers_dir = "//flutter/third_party/vulkan-deps/spirv-headers/src"
angle_spirv_tools_dir = "//flutter/third_party/vulkan-deps/spirv-tools/src"
angle_spirv_cross_dir = "//flutter/third_party/vulkan-deps/spirv-cross/src"
angle_spirv_headers_dir = "//flutter/third_party/vulkan-deps/spirv-headers/src"
angle_vulkan_memory_allocator_dir = "//third_party/vulkan_memory_allocator"

# This is a general Chromium flag, but in the Flutter build only ANGLE needs it
# so it is defined here.
is_cfi = false
13 changes: 13 additions & 0 deletions build_overrides/build.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2019 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.

# The engine build uses some Chromium-sourced versions of third-party
# dependencies (e.g, ANGLE, abseil) to use their GN build files, but we don't
# want the Chromium-specific parts of the build.
build_with_chromium = false

# Perfetto targets fail to build without this variable. It is used by Perfetto
# targets to distinguish embedder builds from Perfetto standalone builds, and
# builds in the Android tree.
perfetto_build_with_embedder = true
6 changes: 6 additions & 0 deletions build_overrides/glslang.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2019 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.

glslang_spirv_tools_dir = "//flutter/third_party/vulkan-deps/spirv-tools/src"
spirv_tools_dir = "//flutter/third_party/vulkan-deps/spirv-tools/src"
11 changes: 11 additions & 0 deletions build_overrides/spirv_tools.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2019 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.

# We are building inside Flutter.
spirv_tools_standalone = false

# Paths to SPIRV-Tools dependencies in Flutter.
spirv_tools_googletest_dir = "//third_party/googletest/googletest/src"
spirv_tools_spirv_headers_dir =
"//flutter/third_party/vulkan-deps/spirv-headers/src"
9 changes: 9 additions & 0 deletions build_overrides/swiftshader.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2019 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.

# We are building SwiftShader in Flutter.
swiftshader_standalone = false

# Path to SwiftShader.
swiftshader_dir = "//flutter/third_party/swiftshader"
11 changes: 11 additions & 0 deletions build_overrides/vulkan_headers.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2020 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.

# This file is needed by the vulkan-headers build, but doesn't need to actually
# set anything.

if (is_linux) {
vulkan_use_x11 = true
vulkan_use_wayland = true
}
8 changes: 8 additions & 0 deletions build_overrides/vulkan_loader.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2020 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.

vulkan_headers_dir = "//flutter/third_party/vulkan-deps/vulkan-headers/src"

# Vulkan loader build options
vulkan_loader_shared = true
9 changes: 9 additions & 0 deletions build_overrides/vulkan_tools.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2020 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.

vulkan_headers_dir = "//flutter/third_party/vulkan-deps/vulkan-headers/src"

# Subdirectories for generated files
vulkan_data_subdir = ""
vulkan_gen_subdir = ""
5 changes: 5 additions & 0 deletions build_overrides/vulkan_utility_libraries.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 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.

vulkan_headers_dir = "//flutter/third_party/vulkan-deps/vulkan-headers/src"
15 changes: 15 additions & 0 deletions build_overrides/vulkan_validation_layers.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 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.

vulkan_headers_dir = "//flutter/third_party/vulkan-deps/vulkan-headers/src"
vulkan_utility_libraries_dir =
"//flutter/third_party/vulkan-deps/vulkan-utility-libraries/src"
vvl_spirv_tools_dir = "//flutter/third_party/vulkan-deps/spirv-tools/src"
vvl_glslang_dir = "//flutter/third_party/vulkan-deps/spirv-tools/src"

# robin_hood_headers_dir = "//external/robin-hood-hashing/src/include"

# Subdirectories for generated files
vulkan_data_subdir = "vulkan-data"
vulkan_gen_subdir = ""
8 changes: 8 additions & 0 deletions build_overrides/wayland.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2019 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.

# ANGLE expects this to be here.

# Flutter has no wayland third-party dir
wayland_gn_dir = ""
1 change: 1 addition & 0 deletions tools/licenses/lib/paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ final Set<String> skippedPaths = <String>{
r'build_overrides', // only used by build
r'buildtools', // only used by build
r'flutter/build',
r'flutter/build_overrides', // only used by build
r'flutter/ci',
r'flutter/docs',
r'flutter/flutter_frontend_server',
Expand Down