File tree 1 file changed +16
-1
lines changed
lldb/tools/debugserver/source
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,21 @@ endif()
154
154
155
155
add_definitions (-DLLDB_USE_OS_LOG)
156
156
157
+ # Make sure we have the macOS SDK root as mig needs it and will silently
158
+ # fail to generate its output files without it.
159
+ if (CMAKE_OSX_SYSROOT)
160
+ set (MIG_SYSROOT ${CMAKE_OSX_SYSROOT} )
161
+ else ()
162
+ execute_process (COMMAND xcrun --show-sdk-path
163
+ OUTPUT_VARIABLE MIG_SYSROOT
164
+ ERROR_QUIET
165
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
166
+ endif ()
167
+
168
+ if (NOT MIG_SYSROOT)
169
+ message (FATAL_ERROR "Unable to obtain sysroot required by mig (Mach Interface Generator). Set CMAKE_OSX_SYSROOT to explicitly specify a sysroot." )
170
+ endif ()
171
+
157
172
if (${CMAKE_OSX_SYSROOT} MATCHES ".Internal.sdk$" )
158
173
message (STATUS "LLDB debugserver energy support is enabled" )
159
174
add_definitions (-DLLDB_ENERGY)
@@ -177,7 +192,7 @@ endif()
177
192
separate_arguments (MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS} " )
178
193
179
194
add_custom_command (OUTPUT ${generated_mach_interfaces}
180
- VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT } ${CMAKE_CURRENT_SOURCE_DIR} /MacOSX/dbgnub-mig.defs
195
+ VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${MIG_SYSROOT } ${CMAKE_CURRENT_SOURCE_DIR} /MacOSX/dbgnub-mig.defs
181
196
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR} /MacOSX/dbgnub-mig.defs
182
197
)
183
198
You can’t perform that action at this time.
0 commit comments