[Lldb-commits] [lldb] [lldb][cmake] Error out when building debugserver with CMake 4 (PR #138020)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 30 13:16:12 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Chelsea Cassanova (chelcassanova)
<details>
<summary>Changes</summary>
CMake 4 no longer sets the `CMAKE_OSX_SYSROOT` variable by default. If you've updated to CMake 4 on macOS (e.g. with brew) and try building LLDB with CMake/ninja, this will yield an error when building debugserver that clang is unable to run since it tries to compile files that don't exist.
These files are supposed to be generated by the `mig` process. `mig` needs the `CMAKE_OSX_SYSROOT` variable in order to work and without it, it silently fails to generate the files that later on need to be compiled.
This commit will fatal error out of config when building debugserver without having set CMAKE_OSX_SYSROOT.
---
Full diff: https://github.com/llvm/llvm-project/pull/138020.diff
1 Files Affected:
- (modified) lldb/tools/debugserver/source/CMakeLists.txt (+4)
``````````diff
diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
index 1a433898f6aa4..45b16c74f5197 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -154,6 +154,10 @@ endif()
add_definitions(-DLLDB_USE_OS_LOG)
+if(NOT CMAKE_OSX_SYSROOT)
+ message(FATAL_ERROR "debugserver needs the macOS SDK root. Please pass in -DCMAKE_OSX_SYSROOT in your CMake invocation")
+endif()
+
if(${CMAKE_OSX_SYSROOT} MATCHES ".Internal.sdk$")
message(STATUS "LLDB debugserver energy support is enabled")
add_definitions(-DLLDB_ENERGY)
``````````
</details>
https://github.com/llvm/llvm-project/pull/138020
More information about the lldb-commits
mailing list