glfw_sys/
lib.rs

1#![doc = include_str!("../README.md")]
2
3pub use sys::*;
4/// We use the sys module to keep the pre-generated and build-time-generated bindings
5/// separated from each other.
6#[cfg(not(feature = "bindgen"))]
7mod sys {
8    /// if `bindgen` feature is not enabled, we use manually maintained bindings
9    /// for native handles stuff.
10    mod manual;
11    /// if `bindgen` is not enabled, we use pre-generated bindings.
12    mod pregenerated;
13
14    #[allow(
15        unused_imports,
16        reason = "on emscripten target, this module will be empty"
17    )]
18    pub use self::manual::*;
19    pub use self::pregenerated::*;
20}
21/// This module contains bindings generated by `bindgen` during build time.
22#[cfg(feature = "bindgen")]
23mod sys {
24    #![allow(
25        unused,
26        non_upper_case_globals,
27        non_camel_case_types,
28        non_snake_case,
29        improper_ctypes,
30        rustdoc::invalid_codeblock_attributes,
31        rustdoc::invalid_rust_codeblocks,
32        rustdoc::broken_intra_doc_links,
33        reason = "
34        This is a bindgen generated file from C headers and can't be fixed manually.
35        It contains all sorts of code (and other blocks). The [] link syntax is used for
36        @param[in] arg syntax, so links are also broken.
37        "
38    )]
39    // if bindings is enabled, we use bindgen to generate bindings and include them here
40    include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
41}
42
43/// This is a hack to ensure that glfw sources are included when we publish the crate.
44/// If we forgot to recursively clone the submodule and call cargo publish,
45/// this will fail to build due to missing path to header.
46///
47/// We support building from source, so, we need to bundle the sources
48/// with the crate.
49#[allow(unused)]
50const GLFW_HEADER: &str = include_str!("../glfw/include/GLFW/glfw3.h");