We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a1140a commit 5f99c9fCopy full SHA for 5f99c9f
libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -170,6 +170,19 @@ function(_get_common_compile_options output_var flags)
170
list(APPEND compile_options "-idirafter${LIBC_KERNEL_HEADERS}")
171
endif()
172
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
186
187
188
if(LIBC_COMPILER_HAS_FIXED_POINT)
0 commit comments