Skip to content

Commit

Permalink
Add lua-no-oslib feature to other Lua versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglerchris committed Jul 24, 2022
1 parent 9c04d12 commit 6fc043a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/rlua-lua51-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ pkg-config = "0.3.24"
default = []
lua51-pkg-config = []
static = []
lua-no-oslib = []
8 changes: 6 additions & 2 deletions crates/rlua-lua51-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ fn main() {
.file(lua_dir.join("ldump.c"))
.file(lua_dir.join("lfunc.c"))
.file(lua_dir.join("lgc.c"))
.file(lua_dir.join("linit.c"))
.file(lua_dir.join("liolib.c"))
.file(lua_dir.join("llex.c"))
.file(lua_dir.join("lmathlib.c"))
Expand All @@ -49,7 +48,6 @@ fn main() {
.file(lua_dir.join("loadlib.c"))
.file(lua_dir.join("lobject.c"))
.file(lua_dir.join("lopcodes.c"))
.file(lua_dir.join("loslib.c"))
.file(lua_dir.join("lparser.c"))
.file(lua_dir.join("lstate.c"))
.file(lua_dir.join("lstring.c"))
Expand All @@ -61,6 +59,12 @@ fn main() {
.file(lua_dir.join("lvm.c"))
.file(lua_dir.join("lzio.c"));

if !cfg!(feature = "lua-no-oslib") {
cc_config_build = cc_config_build
.file(lua_dir.join("loslib.c"))
.file(lua_dir.join("linit.c"));
}

cc_config_build
.out_dir(dst.join("lib"))
.compile("liblua5.1.a");
Expand Down
1 change: 1 addition & 0 deletions crates/rlua-lua53-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ pkg-config = "0.3.24"
default = []
lua53-pkg-config = []
static = []
lua-no-oslib = []
8 changes: 6 additions & 2 deletions crates/rlua-lua53-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ fn main() {
.file(lua_dir.join("ldump.c"))
.file(lua_dir.join("lfunc.c"))
.file(lua_dir.join("lgc.c"))
.file(lua_dir.join("linit.c"))
.file(lua_dir.join("liolib.c"))
.file(lua_dir.join("llex.c"))
.file(lua_dir.join("lmathlib.c"))
.file(lua_dir.join("lmem.c"))
.file(lua_dir.join("loadlib.c"))
.file(lua_dir.join("lobject.c"))
.file(lua_dir.join("lopcodes.c"))
.file(lua_dir.join("loslib.c"))
.file(lua_dir.join("lparser.c"))
.file(lua_dir.join("lstate.c"))
.file(lua_dir.join("lstring.c"))
Expand All @@ -65,6 +63,12 @@ fn main() {
.file(lua_dir.join("lvm.c"))
.file(lua_dir.join("lzio.c"));

if !cfg!(feature = "lua-no-oslib") {
cc_config_build = cc_config_build
.file(lua_dir.join("loslib.c"))
.file(lua_dir.join("linit.c"));
}

cc_config_build
.out_dir(dst.join("lib"))
.compile("liblua5.3.a");
Expand Down

0 comments on commit 6fc043a

Please sign in to comment.