[Lldb-commits] [lldb] [lldb-dap] Fix build when using precompiled header and Xcode generator. (PR #196366)
via lldb-commits
lldb-commits at lists.llvm.org
Thu May 7 09:51:57 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Ebuka Ezike (da-viper)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/196366.diff
1 Files Affected:
- (modified) lldb/tools/lldb-dap/CMakeLists.txt (+7)
``````````diff
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})
``````````
</details>
https://github.com/llvm/llvm-project/pull/196366
More information about the lldb-commits
mailing list