Skip to content

Commit 98a888f

Browse files
committed
Add feature to allow compiling against more platforms for OpenDream
1 parent 299384d commit 98a888f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

crates/byondapi-rs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ byond-515-1621 = [
2626
"byondapi-sys/byond-515-1621",
2727
]
2828
byond-516-1651 = ["byondapi-sys/byond-516-1651"]
29+
opendream = ["byondapi-sys/opendream"]

crates/byondapi-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ doxygen-rs = "0.4"
2727
default = ["byond-516-1651"]
2828
byond-515-1621 = []
2929
byond-516-1651 = []
30+
opendream = []

crates/byondapi-sys/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
)]
88
use std::ops::Deref;
99

10-
#[cfg(not(target_pointer_width = "32"))]
10+
#[cfg(all(not(target_pointer_width = "32"), not(feature = "opendream")))]
1111
compile_error!("BYOND API only functions with 32-bit targets");
1212

13-
#[cfg(not(target_arch = "x86"))]
13+
#[cfg(all(not(target_arch = "x86"), not(feature = "opendream")))]
1414
compile_error!("BYOND API only functions on x86 targets");
1515

16-
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
16+
#[cfg(all(
17+
not(any(target_os = "linux", target_os = "windows")),
18+
not(feature = "opendream")
19+
))]
1720
compile_error!("BYOND API only supports Windows and Linux");
1821

1922
// Include byondapi-c bindings (generated by build.rs)

0 commit comments

Comments
 (0)