Skip to content

Commit

Permalink
Add typical sdk paths 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 27, 2020
1 parent 143c72f commit 56f3db2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/ffi_c/extconf.rb
Expand Up @@ -8,7 +8,11 @@ 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",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi",
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi")

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

0 comments on commit 56f3db2

Please sign in to comment.