Skip to content

[lldb][cmake] Error out when building debugserver with CMake 4 #10704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lldb/tools/debugserver/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,21 @@ endif()

add_definitions(-DLLDB_USE_OS_LOG)

# Make sure we have the macOS SDK root as mig needs it and will silently
# fail to generate its output files without it.
if(CMAKE_OSX_SYSROOT)
set(MIG_SYSROOT ${CMAKE_OSX_SYSROOT})
else()
execute_process(COMMAND xcrun --show-sdk-path
OUTPUT_VARIABLE MIG_SYSROOT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(NOT MIG_SYSROOT)
message(FATAL_ERROR "Unable to obtain sysroot required by mig (Mach Interface Generator). Set CMAKE_OSX_SYSROOT to explicitly specify a sysroot.")
endif()

if(${CMAKE_OSX_SYSROOT} MATCHES ".Internal.sdk$")
message(STATUS "LLDB debugserver energy support is enabled")
add_definitions(-DLLDB_ENERGY)
Expand All @@ -177,7 +192,7 @@ endif()
separate_arguments(MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS}")

add_custom_command(OUTPUT ${generated_mach_interfaces}
VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${MIG_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
)

Expand Down