File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed
Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,20 @@ if(explicit_target_triple AND
216216 endif ()
217217endif ()
218218
219+ if (LIBC_TARGET_OS_IS_DARWIN)
220+ execute_process (
221+ COMMAND xcrun --sdk macosx --show-sdk-path
222+ OUTPUT_VARIABLE MACOSX_SDK_PATH
223+ RESULT_VARIABLE MACOSX_SDK_PATH_RESULT
224+ OUTPUT_STRIP_TRAILING_WHITESPACE
225+ )
226+ if (MACOSX_SDK_PATH_RESULT EQUAL 0)
227+ list (APPEND LIBC_COMPILE_OPTIONS_DEFAULT "-I" "${MACOSX_SDK_PATH} /usr/include" )
228+ else ()
229+ message (WARNING "Could not find macOS SDK path. `xcrun --sdk macosx --show-sdk-path` failed." )
230+ endif ()
231+ endif ()
232+
219233
220234# Windows does not support full mode build.
221235if (LIBC_TARGET_OS_IS_WINDOWS AND LLVM_LIBC_FULL_BUILD)
Original file line number Diff line number Diff line change @@ -170,19 +170,6 @@ function(_get_common_compile_options output_var flags)
170170 list (APPEND compile_options "-idirafter${LIBC_KERNEL_HEADERS} " )
171171 endif ()
172172 endif ()
173- if (LIBC_TARGET_OS_IS_DARWIN)
174- execute_process (
175- COMMAND xcrun --sdk macosx --show-sdk-path
176- OUTPUT_VARIABLE MACOSX_SDK_PATH
177- RESULT_VARIABLE MACOSX_SDK_PATH_RESULT
178- OUTPUT_STRIP_TRAILING_WHITESPACE
179- )
180- if (MACOSX_SDK_PATH_RESULT EQUAL 0)
181- list (APPEND compile_options "-I" "${MACOSX_SDK_PATH} /usr/include" )
182- else ()
183- message (WARNING "Could not find macOS SDK path. `xcrun --sdk macosx --show-sdk-path` failed." )
184- endif ()
185- endif ()
186173 endif ()
187174
188175 if (LIBC_COMPILER_HAS_FIXED_POINT)
You can’t perform that action at this time.
0 commit comments