[Lldb-commits] [lldb] [lldb-dap] Fix build when using precompiled header and Xcode generator. (PR #196366)
Ebuka Ezike via lldb-commits
lldb-commits at lists.llvm.org
Thu May 7 09:51:07 PDT 2026
https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/196366
When building with precompiled headers and Xcode as a generator, It adds obj.lldbDAP.dir/${BUILD_TYPE}/cmake_pch.xxx but does not generate one causing the build to fail.
This might have to do with `add_llvm_library` adding a source file `Dummy.c` to any object it creates if using Xcode as a generator and `lldbDAP` object not declaring it's LINK_LIBS and LINK_COMPONENTS.
>From 64e14ece0ade29c9fc5cc588af2a0f16fd548d99 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <e_ezike at apple.com>
Date: Thu, 7 May 2026 17:43:05 +0100
Subject: [PATCH] [lldb-dap] Fix build when using precompiled header and Xcode
generator.
When building with precompiled headers and Xcode as a generator,
It adds obj.lldbDAP.dir/${BUILD_TYPE}/cmake_pch.xxx but does not generate one
causing the build to fail.
This might have to do with `add_llvm_library` adding a source file `Dummy.c`
to any object it creates if using Xcode as a generator and `lldbDAP` object
not declaring it's LINK_LIBS and LINK_COMPONENTS.
---
lldb/tools/lldb-dap/CMakeLists.txt | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lldb/tools/lldb-dap/CMakeLists.txt b/lldb/tools/lldb-dap/CMakeLists.txt
index 1a8f167ef0a42..0e309d79376ac 100644
--- a/lldb/tools/lldb-dap/CMakeLists.txt
+++ b/lldb/tools/lldb-dap/CMakeLists.txt
@@ -77,6 +77,13 @@ add_lldb_library(lldbDAP OBJECT
Protocol/ProtocolRequests.cpp
)
+# When building with precompiled headers and Xcode as a generator,
+# It adds obj.lldbDAP.dir/${BUILD_TYPE}/cmake_pch.xxx but does not generate one
+# causing the build to fail.
+if(CMAKE_GENERATOR STREQUAL "Xcode")
+ set_target_properties(lldbDAP PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
+endif()
+
target_include_directories(lldbDAP
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
More information about the lldb-commits
mailing list