Skip to content

Commit bac62ee

Browse files
authored
[llvm] Add CMake flag to compile out the telemetry framework (llvm#124850)
Add a CMake flag (LLVM_BUILD_TELEMETRY) to disable building the telemetry framework. The flag being enabled does *not* mean that telemetry is being collected, it merely means we're building the generic telemetry framework. Hence the flag is enabled by default. Motivated by this Discourse thread: https://discourse.llvm.org/t/how-to-disable-building-llvm-clang-telemetry/84305
1 parent db60244 commit bac62ee

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

llvm/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OF
829829
option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
830830
option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON)
831831
option (LLVM_ENABLE_BINDINGS "Build bindings." ON)
832+
option (LLVM_BUILD_TELEMETRY "Build the telemtry library. This does not enable telemetry." ON)
832833

833834
set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/llvm/doxygen-html"
834835
CACHE STRING "Doxygen-generated HTML documentation install directory")

llvm/lib/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ add_subdirectory(ProfileData)
4141
add_subdirectory(Passes)
4242
add_subdirectory(TargetParser)
4343
add_subdirectory(TextAPI)
44-
add_subdirectory(Telemetry)
44+
if (LLVM_BUILD_TELEMETRY)
45+
add_subdirectory(Telemetry)
46+
endif()
4547
add_subdirectory(ToolDrivers)
4648
add_subdirectory(XRay)
4749
if (LLVM_INCLUDE_TESTS)

llvm/unittests/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ add_subdirectory(Support)
6363
add_subdirectory(TableGen)
6464
add_subdirectory(Target)
6565
add_subdirectory(TargetParser)
66-
add_subdirectory(Telemetry)
66+
if (LLVM_BUILD_TELEMETRY)
67+
add_subdirectory(Telemetry)
68+
endif()
6769
add_subdirectory(Testing)
6870
add_subdirectory(TextAPI)
6971
add_subdirectory(Transforms)

0 commit comments

Comments
 (0)