bjz/gl-rs — pull request #95 by Tomaka17 (2014-07-03 10:54:59+00:00)
Title: Use rustc's macro system to generate the bindings

Currently the building is done in three steps: first a generator is compiled, then the generator is used to build `gl.rs`, and finally `gl.rs` is compiled.
This requires using a makefile and/or a shell script.

This commit would change this system to:
* Build a library named `gl_generator` which declares a macro named `generate_gl_bindings!` similar to what `log` does for example
* Build the GL library (which depends on `gl_generator`) from the `src/gl_bind.rs` file, which invokes this macro.

The advantages are:
* Compilation on windows becomes far easier (the only remaining issue for windows compilation is that you need to provide libxml2)
* In the future you will be able to replace `generate_gl_bindings!("gl", "gl", "core", "4.3")` by `generate_gl_bindings!(cfg!("gl_namespace"), cfg!("gl_api"), cfg!("gl_profile"), cfg!("gl_version"))` and fully support Cargo's profiles system
* The structure of the repository can now be read-only because you no longer need to build `gl.rs`
* Not having to use a shell script makes things cleaner

Note that I have only modified this for the Cargo build system. Other build systems still use the current method.