From a1dc40d9355faa3034ea65432add69af5f9fbb76 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 6 Aug 2025 10:31:25 -0700 Subject: [PATCH] [lldb][tests] Fix build with LLVM_ENABLE_SWIFT_SUPPORT=OFF Fix the unittest build when swift support is off. (cherry picked from commit d3d0ac9b647a94df02445781f7c8513a8a6cf293) --- lldb/unittests/Core/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lldb/unittests/Core/CMakeLists.txt b/lldb/unittests/Core/CMakeLists.txt index 77c084db5a9c5..9d11c02d9837c 100644 --- a/lldb/unittests/Core/CMakeLists.txt +++ b/lldb/unittests/Core/CMakeLists.txt @@ -1,3 +1,11 @@ +set(SWIFT_SOURCES + SwiftDemanglingPartsTest.cpp +) + +set(LLVM_OPTIONAL_SOURCES ${SWIFT_SOURCES}) +if (NOT LLDB_ENABLE_SWIFT_SUPPORT) + unset(SWIFT_SOURCES) +endif() add_lldb_unittest(LLDBCoreTests DebuggerTest.cpp @@ -13,10 +21,11 @@ add_lldb_unittest(LLDBCoreTests RichManglingContextTest.cpp SourceLocationSpecTest.cpp SourceManagerTest.cpp - SwiftDemanglingPartsTest.cpp TelemetryTest.cpp UniqueCStringMapTest.cpp + ${SWIFT_SOURCES} + LINK_COMPONENTS Support Telemetry