Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bazel] Restore libpfm as a conditional dependency for exegesis.
We used to have `pfm` built into exegesis, although since it's an external dependency we marked it as a manual target. Because of this we didn't have buildbot coverage and so we removed it in D134510 after we had a few breakages that weren't caught. This adds it back, but with three possible states similar to the story with `mpfr`, i.e. it can either be disabled, built from external sources (git/make), or use whatever `-lpfm` is installed on the system. This change is modeled after D119547. Like that patch, the default is off (matching the status quo), but unlike that patch we don't enable it for CI because IIRC we don't have the package installed there, and building from source might be expensive. We could enable it later either after installing it on buildbot machines or by measuring build cost and deeming it OK. Reviewed By: GMNGeoffrey Differential Revision: https://reviews.llvm.org/D138470
- Loading branch information
Showing
4 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "make_variant") | ||
|
||
filegroup( | ||
name = "sources", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
make_variant( | ||
name = "pfm", | ||
copts = ["-w"], | ||
lib_name = "libpfm", | ||
lib_source = ":sources", | ||
toolchain = "@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
alias( | ||
name = "pfm_external", | ||
actual = "@pfm//:pfm_", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_library( | ||
name = "pfm_system", | ||
linkopts = ["-lpfm"], | ||
visibility = ["//visibility:public"], | ||
) |