[llvm] Define -DLLVM_BUILD_TELEMETRY to be used in ifdef (PR #126746)

Vy Nguyen via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 10:05:42 PST 2025


https://github.com/oontvoo updated https://github.com/llvm/llvm-project/pull/126746

>From 008537373cd928fea9ac04b1aed39c2ecafec65a Mon Sep 17 00:00:00 2001
From: Vy Nguyen <vyng at google.com>
Date: Tue, 11 Feb 2025 10:36:06 -0500
Subject: [PATCH 1/2] Define -DLLVM_BUILD_TELEMETRY to be used in ifdef (by
 users of Telemetry)

---
 llvm/lib/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt
index d0a2bc929438179..08e3d7ddb8c12c7 100644
--- a/llvm/lib/CMakeLists.txt
+++ b/llvm/lib/CMakeLists.txt
@@ -43,6 +43,7 @@ add_subdirectory(TargetParser)
 add_subdirectory(TextAPI)
 if (LLVM_BUILD_TELEMETRY)
   add_subdirectory(Telemetry)
+  add_definitions(-DLLDB_BUILD_TELEMETRY)
 endif()
 add_subdirectory(ToolDrivers)
 add_subdirectory(XRay)

>From f2a3822291d7153359286bd5efc4c080c21adedd Mon Sep 17 00:00:00 2001
From: Vy Nguyen <vyng at google.com>
Date: Tue, 11 Feb 2025 11:22:36 -0500
Subject: [PATCH 2/2] add macro def in llvm-config.h

---
 llvm/include/llvm/Config/llvm-config.h.cmake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake
index 629977cc11d6836..239f9dd3f38db18 100644
--- a/llvm/include/llvm/Config/llvm-config.h.cmake
+++ b/llvm/include/llvm/Config/llvm-config.h.cmake
@@ -201,4 +201,7 @@
 /* Define if logf128 is available */
 #cmakedefine LLVM_HAS_LOGF128
 
+/* Define if building LLVM with LLVM_BUILD_TELEMETRY */
+#cmakedefine LLVM_BUILD_TELEMETRY ${LLVM_BUILD_TELEMETRY}
+
 #endif



More information about the llvm-commits mailing list