Feature gate advanced stuff

This commit is contained in:
William Venner 2021-10-27 17:17:24 +01:00
parent 3ec09cd995
commit 7df4513690
3 changed files with 34 additions and 23 deletions

2
Cargo.lock generated
View File

@ -109,7 +109,7 @@ dependencies = [
[[package]] [[package]]
name = "gmod" name = "gmod"
version = "7.0.1" version = "8.0.0"
dependencies = [ dependencies = [
"cfg_table", "cfg_table",
"cstr", "cstr",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "gmod" name = "gmod"
version = "7.0.2" version = "8.0.0"
authors = ["William Venner <william@venner.io>"] authors = ["William Venner <william@venner.io>"]
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"
@ -9,17 +9,23 @@ repository = "https://github.com/WilliamVenner/gmod-rs"
keywords = ["gmod", "garrysmod", "module", "glua"] keywords = ["gmod", "garrysmod", "module", "glua"]
categories = ["api-bindings", "external-ffi-bindings", "game-development", "development-tools"] categories = ["api-bindings", "external-ffi-bindings", "game-development", "development-tools"]
[features]
default = ["hax"]
hax = ["ctor", "skidscan", "detour", "fn_type_alias", "fn_abi", "cfg_table", "null_fn", "fn_has_this"]
[dependencies] [dependencies]
libloading = "0"
detour = "0"
skidscan = "2"
cstr = "0"
lazy_static = "1"
ctor = "0"
gmod-macros = { version = "1.0.0", path = "../gmod-macros" } gmod-macros = { version = "1.0.0", path = "../gmod-macros" }
fn_type_alias = "0" libloading = "0"
fn_abi = "2" cstr = "0"
cfg_table = "0" lazy_static = "1"
null_fn = "0"
fn_has_this = "0" detour = { version = "0", optional = true }
ctor = { version = "0", optional = true }
skidscan = { version = "2", optional = true }
fn_type_alias = { version = "0", optional = true }
fn_abi = { version = "2", optional = true }
cfg_table = { version = "0", optional = true }
null_fn = { version = "0", optional = true }
fn_has_this = { version = "0", optional = true }

View File

@ -1,19 +1,24 @@
#![feature(c_unwind)] #![feature(c_unwind)]
#![feature(thread_id_value)] #![feature(thread_id_value)]
pub use libloading;
pub use detour;
pub use skidscan as sigscan;
pub use cstr; pub use cstr;
pub use ctor::{ctor as dllopen, dtor as dllclose}; pub use libloading;
pub use gmod_macros::*; pub use gmod_macros::*;
// Reexport common macros #[cfg(feature = "hax")]
pub use fn_type_alias::*; mod haxports {
pub use fn_abi::*; pub use detour;
pub use cfg_table::*; pub use skidscan as sigscan;
pub use null_fn::*; pub use ctor::{ctor as dllopen, dtor as dllclose};
pub use fn_has_this::*;
pub use fn_type_alias::*;
pub use fn_abi::*;
pub use cfg_table::*;
pub use null_fn::*;
pub use fn_has_this::*;
}
#[cfg(feature = "hax")]
pub use haxports::*;
/// Lua interface /// Lua interface
pub mod lua; pub mod lua;