aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2018-02-27 17:57:10 +0000
committerMatthew Collins <[email protected]>2018-02-27 17:57:10 +0000
commit2944a722c62b5d177db27826c0e4b4161f97a1fe (patch)
tree6fb7472a01e667a4e7fe61f42763a352799cee43
parentImprove error handling (diff)
downloadsteamworks-rs-2944a722c62b5d177db27826c0e4b4161f97a1fe.tar.xz
steamworks-rs-2944a722c62b5d177db27826c0e4b4161f97a1fe.zip
Add a feature for docs-only builds
-rw-r--r--Cargo.toml5
-rw-r--r--steamworks-sys/Cargo.toml7
-rw-r--r--steamworks-sys/build.rs9
3 files changed, 19 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 04da568..2c643bf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,6 +3,11 @@ name = "steamworks"
version = "0.1.0"
authors = ["matt"]
+[features]
+default = []
+# Skip looking for the steamworks sdk for docs builds
+docs-only = ["steamworks-sys/docs-only"]
+
[workspace]
members = [
"./steamworks-sys"
diff --git a/steamworks-sys/Cargo.toml b/steamworks-sys/Cargo.toml
index b672938..59c2b9d 100644
--- a/steamworks-sys/Cargo.toml
+++ b/steamworks-sys/Cargo.toml
@@ -4,6 +4,13 @@ version = "0.1.0"
authors = ["matt"]
build = "build.rs"
+
+[features]
+default = []
+# Skip looking for the steamworks sdk for docs builds
+docs-only = []
+
+
[dependencies]
libc = "0.2.36"
diff --git a/steamworks-sys/build.rs b/steamworks-sys/build.rs
index 475470c..1c8ed72 100644
--- a/steamworks-sys/build.rs
+++ b/steamworks-sys/build.rs
@@ -1,10 +1,15 @@
extern crate cc;
-use std::env;
-use std::path::Path;
+#[cfg(feature = "docs-only")]
+fn main() {}
+
+#[cfg(not(feature = "docs-only"))]
fn main() {
+ use std::env;
+ use std::path::Path;
+
let sdk_loc = env::var("STEAM_SDK_LOCATION")
.expect("STEAM_SDK_LOCATION must be set");
let sdk_loc = Path::new(&sdk_loc);