[PATCH] D156095: [Bazel] Introduce `//compiler-rt:profile`

NAKAMURA Takumi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 06:23:42 PDT 2023


chapuni updated this revision to Diff 555718.
chapuni added a comment.

- Reformat.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156095/new/

https://reviews.llvm.org/D156095

Files:
  utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel


Index: utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
===================================================================
--- /dev/null
+++ utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
@@ -0,0 +1,51 @@
+# 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
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+)
+
+licenses(["notice"])
+
+cc_library(
+    name = "config",
+    defines = select({
+        "@platforms//os:linux": [
+            "COMPILER_RT_HAS_ATOMICS=1",
+            "COMPILER_RT_HAS_FCNTL_LCK=1",
+            "COMPILER_RT_HAS_UNAME=1",
+        ],
+        # Will raises error unless supported platforms.
+    }),
+)
+
+WIN32_ONLY_FILES = [
+    "lib/profile/WindowsMMap.c",
+]
+
+cc_library(
+    name = "profile",
+    srcs = glob(
+        [
+            "lib/profile/*.c",
+            "lib/profile/*.cpp",
+            "lib/profile/*.h",
+        ],
+        exclude = WIN32_ONLY_FILES,
+    ) + select({
+        "@platforms//os:windows": WIN32_ONLY_FILES,
+        "//conditions:default": []
+    }),
+    hdrs = glob([
+        "include/profile/*.inc",
+    ]),
+    includes = [
+        "include",
+    ],
+    deps = [
+        ":config",
+    ],
+    linkstatic = True,
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156095.555718.patch
Type: text/x-patch
Size: 1418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230904/0063a5a5/attachment.bin>


More information about the llvm-commits mailing list