rutabaga_gfx: fix building with llvm
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
diff --git a/rutabaga_gfx/build.rs b/rutabaga_gfx/build.rs
|
||||
index bd5a9be96..d2244c4c6 100644
|
||||
--- a/rutabaga_gfx/build.rs
|
||||
+++ b/rutabaga_gfx/build.rs
|
||||
@@ -194,9 +194,14 @@ fn gfxstream() -> Result<()> {
|
||||
pkg_config::Config::new().probe("libdrm")?;
|
||||
}
|
||||
|
||||
+ let mut use_clang = target_os.contains("macos");
|
||||
+ if std::env::var("USE_CLANG").is_ok() {
|
||||
+ use_clang = true;
|
||||
+ }
|
||||
+
|
||||
// Need to link against libc++ or libstdc++. Apple is clang-only, while by default other
|
||||
// Unix platforms use libstdc++.
|
||||
- if target_os.contains("macos") {
|
||||
+ if use_clang {
|
||||
println!("cargo:rustc-link-lib=dylib=c++");
|
||||
} else if target_os.contains("linux") || target_os.contains("nto") {
|
||||
println!("cargo:rustc-link-lib=dylib=stdc++");
|
||||
@@ -40,8 +40,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
})
|
||||
# Install the dylib on Darwin.
|
||||
./darwin-install.patch
|
||||
# Patch for libc++, drop in next update
|
||||
# https://chromium.googlesource.com/crosvm/crosvm/+/8ae3c23b2e3899de33b973fc636909f1eb3dc98c
|
||||
./link-cxx.patch
|
||||
];
|
||||
|
||||
env = lib.optionalAttrs stdenv.hostPlatform.useLLVM {
|
||||
USE_CLANG = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cargo
|
||||
pkg-config
|
||||
|
||||
Reference in New Issue
Block a user