From 546274cc5f7f15e36751b9a3af9ce0b9c48bd8ba Mon Sep 17 00:00:00 2001 From: Steven Fontaine Date: Fri, 24 Nov 2023 15:17:22 -0700 Subject: [PATCH] add documentation --- README.md | 6 ++++-- shaderc-sys/build/build.rs | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e80e5f..a0557fc 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,11 @@ are passed through to shaderc-sys when building shaderc-rs: 1. Building from source, if the native shaderc library is not found via the above steps. -For each library directory, the build script will try to fine and link to the +For each library directory, the build script will try to find and link to the dynamic native shaderc library `shaderc_shared` first and the static native -shaderc library `shaderc_combined` next. +shaderc library `shaderc_combined` next. To prefer searching for the static +library first and the dynamic library next, the option +`--features prefer-static-linking` may be used. Building from Source -------------------- diff --git a/shaderc-sys/build/build.rs b/shaderc-sys/build/build.rs index 05695f9..4700062 100644 --- a/shaderc-sys/build/build.rs +++ b/shaderc-sys/build/build.rs @@ -281,8 +281,11 @@ fn main() { static_lib_path.exists(), config_prefer_static_linking, ) { + // if dylib not exist OR prefer static lib and static lib exist, static. (false, true, _) | (_, true, true) => Some((SHADERC_STATIC_LIB, "static")), + // otherwise, if dylib exist, dynamic (true, _, _) => Some((SHADERC_SHARED_LIB, "dylib")), + // neither dylib nor static lib exist _ => None, } } {