You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify and fix bindgen setup both for native and cross compilation
The current setup requires 2 environment variables for
cross-compilation, and can fail to build under some circumstances on a
freshly installed OSX + Xcode machine.
This change simplifies the setup by:
- On native builds, using `xcrun --show-sdk-path` instead of
`xcode-select -p` to find the SDK.
- On cross builds, checking COREAUDIO_SDK_PATH.
- Pass --target to clang, which makes things work for cross-compilation
with plain clang (as opposed to osxcross).
- Pass -isysroot to clang instead of -F, which makes it find all
possible headers in the SDK, especially TargetConditionals.h, which
lives in $COREAUDIO_SDK_PATH/usr/include.
- Instruct cargo of the environment variables that affect the build
script.
COREAUDIO_CFLAGS is left as a convenience, for now.
Copy file name to clipboardExpand all lines: README.md
+3-11
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,10 @@ Raw bindings to Apple's Core Audio API for macos and iOS generated using [rust-b
10
10
11
11
When cross-compiling for MacOS on Linux there are two environment variables that are used to configure how `coreaudio-sys` finds the required headers and libraries. The following examples assume that you have OSXCross installed at `/build/osxcross`.
12
12
13
-
#### `COREAUDIO_CFLAGS`
13
+
#### `MACOS_SDK_PATH`
14
14
15
-
This allows you to add arbitrary flags to the `clang` call that is made when auto-generating the Rust bindings to coreaudio. This will need to be set to include some headers used by coreaudio:
15
+
This tell `coreaudio-sys` where to find the MacOS SDK:
0 commit comments