Author: Vy Nguyen Date: 2025-02-12T09:33:52-05:00 New Revision: fc4d87100a01f08dbdf78b68e1a6a5c2584d840d
URL: https://github.com/llvm/llvm-project/commit/fc4d87100a01f08dbdf78b68e1a6a5c2584d840d DIFF: https://github.com/llvm/llvm-project/commit/fc4d87100a01f08dbdf78b68e1a6a5c2584d840d.diff LOG: Define -DLLVM_BUILD_TELEMETRY to be used in ifdef (#126746) Background: Telemetry code isn't always built (controlled by this LLVM_BUILD_TELEMETRY cmake flag) This means users of the library may not have the library. So we're definding the `-DLLVM_BUILD_TELEMETRY` to be used in ifdef. Added: Modified: lldb/source/Core/CMakeLists.txt lldb/source/Core/Telemetry.cpp llvm/include/llvm/Config/llvm-config.h.cmake Removed: ################################################################################ diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt index cf5f6ac9da489..82fb5f42f9f4b 100644 --- a/lldb/source/Core/CMakeLists.txt +++ b/lldb/source/Core/CMakeLists.txt @@ -18,7 +18,6 @@ endif() if (LLVM_BUILD_TELEMETRY) set(TELEMETRY_DEPS Telemetry) - add_definitions(-DLLDB_BUILD_TELEMETRY) endif() # TODO: Add property `NO_PLUGIN_DEPENDENCIES` to lldbCore diff --git a/lldb/source/Core/Telemetry.cpp b/lldb/source/Core/Telemetry.cpp index 99f5d43ccbaf0..0d0d7c1df3bb9 100644 --- a/lldb/source/Core/Telemetry.cpp +++ b/lldb/source/Core/Telemetry.cpp @@ -6,7 +6,9 @@ // //===----------------------------------------------------------------------===// -#ifdef LLDB_BUILD_TELEMETRY +#include "llvm/Config/llvm-config.h" + +#ifdef LLVM_BUILD_TELEMETRY #include "lldb/Core/Telemetry.h" #include "lldb/Core/Debugger.h" @@ -71,4 +73,4 @@ llvm::Error TelemetryManager::preDispatch(TelemetryInfo *entry) { } // namespace telemetry } // namespace lldb_private -#endif // LLDB_BUILD_TELEMETRY +#endif // LLVM_BUILD_TELEMETRY diff --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake index 629977cc11d68..239f9dd3f38db 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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits