Provides JNI-Bindings and other utilities based on glslang. https://github.com/KhronosGroup/glslang
f05c076e26b04cbcc9bf2df815bbdc9c620d89ad
Same as glslang:
- A C++11 compiler. (For MSVS: 2015 is recommended, 2013 is fully supported/tested, and 2010 support is attempted, but not tested.)
- [CMake][cmake]: for generating compilation targets.
- make: Linux, ninja is an alternative, if configured.
- [Python 3.x][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools and the 'External' subdirectory does not exist.)
- [bison][bison]: optional, but needed when changing the grammar (glslang.y).
- [googletest][googletest]: optional, but should use if making any changes to glslang.
Additional Notes:
- On Windows currently Visual Studio Build Tools are needed.
vcvarsall.bat
must be visible in shell opened by make. Git Bash or similar might fail on execution. Consider using cmd for calling make in that case.
The following steps assume a Bash shell. On Windows, that could be the Git Bash shell or some other shell of your choosing.
Follow the Build steps at https://github.com/KhronosGroup/glslang.
Build dir will be refered to as $GLSLANG_BUILD_DIR
Location of glslang_Java on your local installation will be referred to as $SOURCE_DIR
.
cd <parent of where you want glslang_Java to be>
git clone https://github.com/Destranix/glslang_Java.git
Find glslang lib(.lib/.a/.so) files in $GLSLANG_BUILD_DIR
. They should lie under $GLSLANG_BUILD_DIR/install
or $GLSLANG_BUILD_DIR/$(pwd)/install
.
Copy them into $SOURCE_DIR/C/lib
.
cd $SOURCE_DIR/C
make Release
Instead of Release
there's another existing target called Debug
.
Result should be a dynamic library suitable for your system.
The script packJar
cann be used to generate Jars packing all necessary classes and native libraries. Simply execute the script in $SOURCE_DIR
.
The following command-line options are available:
-f=[DIR]
: Allows to specify the outputfile containing the classes and native libraries.DIR
is either an absolute path or relative to current working directory.-s=[DIR]
: Allows to specify the outputfile containing the sources.DIR
is either an absolute path or relative to current working directory.-no-generate-classes
: Causes script not to generate a .jar containing classes and native libraries.-no-generate-sources
: Causes script not to generate a .jar containing sources.-no-cleanup
: Causes script not to cleanup generated folders and files.
To make use of JNI-Bindings, you'll have to add the path of the generated dynamic library to java.library.path
.
There are several ways to do that. One is, by extending java.library.path
on java execution.
i.e.:
java -cp $SOURCE_DIR -Djava.library.path+=$SOURCE_DIR/C $SOURCE_DIR/Test/Test.java