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
Create shaderc-sys for FFI, building, and linking (#46)
This commit creates a new shaderc-sys crate for Shaderc library FFI, building and linking.
This change separates the concerns and is the recommended way of handling
low-level C libraries.
This commit also enhances Shaderc-sys with the ability to detect and use pre-built
Shaderc libraries. It has the following building and linking behavior:
1. The option `--features build-from-source` will prevent automatic library
detection and force building from source.
2. If the `SHADERC_LIB_DIR` environment variable is set to
`/path/to/shaderc/libs/`, it will take precedence and `libshaderc_combined.a`
(and the glsang and SPIRV libraries on Linux) will be searched in the
`/path/to/shaderc/libs/` directory.
3. On Linux, `/usr/lib/` will be automatically searched for system libraries
if none of the above were given.
4. If no other option was set or succeeded, shaderc-sys will fall back to
checking out and compiling a copy of shaderc. This procedure is quite slow.
This commit also bumps version to 0.5.0. Version 0.4.0 has been skipped and tag will not
be used. History for a prospective split at 0.4.0 into two repos has been obliterated.
The shaderc-sys [`build.rs`](shaderc-sys/build/build.rs) will automatically check out and compile a copy of native C++ shaderc and link to the generated artifacts,
102
+
which requires `git`, `cmake`, and `python` existing in the `PATH`.
103
+
104
+
To build your own libshaderc for the shaderc-sys crate, the following tools must be installed and available on `PATH`:
84
105
-[CMake](https://cmake.org/)
85
106
-[Git](https://git-scm.com/)
86
107
-[Python](https://www.python.org/) (works with both Python 2.x and 3.x, on windows the executable must be named `python.exe`)
On Arch linux, the [shaderc package](https://www.archlinux.org/packages/extra/x86_64/shaderc/) will include glsang and SPIRV libs in a detectable location.
157
+
135
158
### macOS Example Setup
136
159
137
160
Assuming Homebrew:
@@ -152,7 +175,7 @@ This project is initialized and mainly developed by Lei Zhang
0 commit comments