Skip to content

Commit

Permalink
Support overriding perfetto_root_path
Browse files Browse the repository at this point in the history
As part of merging Flutter's flutter/buildroot and flutter/engine repos,
Flutter is migrating all third-party dependencies from //third_party to
//flutter/third_party.

This change allows consumers of the Dart SDK (notably Flutter), to
override the path of their third_party/perfetto directory.

Issue: flutter/flutter#144204
Part of: flutter/flutter#67373
  • Loading branch information
cbracken committed Mar 8, 2024
1 parent f7c2ef5 commit 0d870c2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions runtime/vm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

import("//build_overrides/build.gni")
import("//third_party/protobuf/proto_library.gni")
import("../../build/executable_suffix.gni")
import("../../sdk/lib/async/async_sources.gni")
Expand Down Expand Up @@ -76,7 +77,9 @@ config("libdart_vm_config") {
# .pb.{cc,h} of the official proto library.
template("protozero_library") {
proto_library(target_name) {
perfetto_root_path = "//third_party/perfetto/"
if (!defined(perfetto_root_path)) {
perfetto_root_path = "//third_party/perfetto/"
}

generate_cc = false
generate_python = false
Expand Down Expand Up @@ -146,8 +149,12 @@ proto_library("perfetto_protos_dart") {
# This config needs to be propagated to all targets that depend on
# ":libprotozero".
config("libprotozero_config") {
if (!defined(perfetto_root_path)) {
perfetto_root_path = "//third_party/perfetto/"
}

include_dirs = [
"//third_party/perfetto/include",
"$perfetto_root_path/include",
"$root_gen_dir/third_party/perfetto/build_config",
]
}
Expand All @@ -156,7 +163,7 @@ config("libprotozero_config") {
# proto messages. This target also propagates ":libprotozero_config".
source_set("libprotozero") {
public_configs = [ ":libprotozero_config" ]
deps = [ "//third_party/perfetto/src/protozero:protozero" ]
deps = [ "$perfetto_root_path/src/protozero:protozero" ]
}

library_for_all_configs("libdart_vm") {
Expand Down

0 comments on commit 0d870c2

Please sign in to comment.