blob: dba7464d17df3e2885e827ebbff7d1ad9530e58f [file] [log] [blame]
Jordan Rupprecht4aa77692022-12-28 08:13:20 -08001# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2# See https://llvm.org/LICENSE.txt for license information.
3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5load("@rules_foreign_cc//foreign_cc:defs.bzl", "make_variant")
6
7filegroup(
8 name = "sources",
9 srcs = glob(["**"]),
10)
11
12make_variant(
13 name = "pfm",
14 copts = ["-w"],
15 lib_name = "libpfm",
16 lib_source = ":sources",
Keith Smiley2eb010d2024-03-25 12:47:16 -070017 target_compatible_with = select({
18 "@platforms//os:linux": [],
19 "//conditions:default": ["@platforms//:incompatible"],
20 }),
Jordan Rupprecht4aa77692022-12-28 08:13:20 -080021 toolchain = "@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain",
Keith Smiley2eb010d2024-03-25 12:47:16 -070022 visibility = ["//visibility:private"],
Jordan Rupprecht4aa77692022-12-28 08:13:20 -080023)
24
25alias(
26 name = "pfm_external",
27 actual = "@pfm//:pfm_",
28 visibility = ["//visibility:public"],
29)
30
31cc_library(
32 name = "pfm_system",
33 linkopts = ["-lpfm"],
Keith Smiley2eb010d2024-03-25 12:47:16 -070034 target_compatible_with = select({
35 "@platforms//os:linux": [],
36 "//conditions:default": ["@platforms//:incompatible"],
37 }),
Christian Siggcce18e42024-03-25 20:57:22 +010038 visibility = ["//visibility:public"],
Jordan Rupprecht4aa77692022-12-28 08:13:20 -080039)