Skip to content

Commit

Permalink
Add SDK path on macOS
Browse files Browse the repository at this point in the history
macOS removed `/usr/include` in recent versions of macOS.
This forces the usage of the internal libffi although macOS has a usable one itself.

Related to ffi#757
  • Loading branch information
larskanis committed Mar 30, 2020
1 parent e9dab3c commit 57e69b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/ffi_c/extconf.rb
Expand Up @@ -8,7 +8,8 @@ def system_libffi_usable?
# We need pkg_config or ffi.h
libffi_ok = pkg_config("libffi") ||
have_header("ffi.h") ||
find_header("ffi.h", "/usr/local/include", "/usr/include/ffi")
find_header("ffi.h", "/usr/local/include", "/usr/include/ffi") ||
(find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip) rescue false)

# Ensure we can link to ffi_call
libffi_ok &&= have_library("ffi", "ffi_call", [ "ffi.h" ]) ||
Expand Down

0 comments on commit 57e69b2

Please sign in to comment.