Skip to content

Commit

Permalink
Merge "perfetto: Fix pkg-config compatability with the chromium build…
Browse files Browse the repository at this point in the history
…" into main
  • Loading branch information
primiano authored and Gerrit Code Review committed Oct 27, 2023
2 parents 79731f6 + 3038d38 commit 5e6c2f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gn/perfetto.gni
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ declare_args() {

# Used by CrOS builds. Uses pkg-config to determine the appropriate flags
# for including and linking system libraries.
# set `pkg_config` to the `BUILD_PKG_CONFIG` and
# set `target_pkg_config` to the target `PKG_CONFIG`.
# set `host_pkg_config` to the `BUILD_PKG_CONFIG` and
# set `pkg_config` to the target `PKG_CONFIG`.
# Note: that if this is enabled `perfetto_use_system_protobuf` should be also.
perfetto_use_pkgconfig = false

Expand Down
14 changes: 10 additions & 4 deletions gn/pkg_config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
import("perfetto.gni")

declare_args() {
pkg_config = "pkg-config"
target_pkg_config = "pkg-config"
# These are provided by chromium's build/config/linux/pkg_config.gni, but
# need to be defined if they have not been already.
if (!defined(pkg_config)) {
pkg_config = "pkg-config"
}
if (!defined(host_pkg_config)) {
host_pkg_config = "pkg-config"
}
}

# Defines a config specifying the result of running pkg-config for the given
Expand All @@ -29,9 +35,9 @@ template("pkg_config") {
forward_variables_from(invoker, "*")

if (current_toolchain == host_toolchain) {
_cmd = pkg_config
_cmd = host_pkg_config
} else {
_cmd = target_pkg_config
_cmd = pkg_config
}
_pkg_config_result =
exec_script("//gn/pkg-config_wrapper.py", [ _cmd ] + pkg_deps, "json")
Expand Down

0 comments on commit 5e6c2f5

Please sign in to comment.