Raw bindings for shaderc.
This project was recently split from shaderc-rs to follow the sys crate conventions. The original project shares a git history in order to preserve the change history of the original ffi.rs before the split. This project makes no claims regarding change of copyright from the intact copyright notice brought forward from the original project.
Looking for the original shader-rs crate repository?
This library uses build.rs
to automatically check out
and compile a copy of native C++ shaderc and link to the generated artifacts,
which requires git
, cmake
, and python
existing in the PATH
.
To turn off this feature, specify --no-default-features
when building.
But then you will need to place a copy of the shaderc_combined
static library
to the location (printed out in the warning message) that is scanned by the
linker.
To build the shaderc-rs crate, the following tools must be installed and available on PATH
:
- CMake
- Git
- Python (works with both Python 2.x and 3.x, on windows the executable must be named python.exe
)
- a C++11 compiler
Additionally, the build script can auto detect and use the following if they are on PATH
:
- Ninja
These requirements can be either installed with your favourite package manager or with installers from the projects' websites. Below are some example ways to get setup.
rustup default stable-x86_64-pc-windows-msvc
pacman --noconfirm -Syu mingw-w64-x86_64-cmake mingw-w64-x86_64-python2
NOTE: On Windows if building with MSBuild (the default), it may fail because of
file path too long. That is a limitation of MSBuild.
You can work around either by set the target directory to a shallower one using
cargo --target-dir
, or download Ninja
and make it accessible on PATH
. The build script will automatically detect
and use Ninja instead of MSBuild.
windows-gnu toolchain is not supported but you can instead cross-compile to windows-gnu from windows-msvc.
Steps 1 and 2 are to workaround https://github.com/rust-lang/rust/issues/49078 by using the same mingw that rust uses.
rustup default stable-x86_64-pc-windows-msvc
rustup target install x86_64-pc-windows-gnu
pacman --noconfirm -Syu mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-python2
--target x86_64-pc-windows-gnu
e.g. to run: cargo run --target x86_64-pc-windows-gnu
Use your package manager to install the required dev-tools
For example on ubuntu:
sudo apt-get install build-essential git python cmake
Assuming Homebrew:
brew install cmake
This project is licensed under the Apache 2 license. Please see CONTRIBUTING before contributing.
This project is initialized and mainly developed by Lei Zhang (@antiagainst).
Mr. Dawg K Prime has performed this initial project split. ([@knappador][that guy]).