File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 2828 os : macos-latest
2929 - target : x86_64-pc-windows-msvc
3030 os : windows-latest
31+ - target : wasm32-unknown-emscripten
32+ os : ubuntu-latest
3133 steps :
3234 - uses : actions/checkout@v3
3335 - uses : dtolnay/rust-toolchain@stable
5153 sudo apt-get update -y
5254 sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabi libc6-dev-armel-cross
5355 shell : bash
56+ - name : Install emscripten (wasm32-unknown-emscripten)
57+ if : ${{ matrix.target == 'wasm32-unknown-emscripten' }}
58+ run : |
59+ sudo apt-get update -y
60+ sudo apt-get install -y --no-install-recommends emscripten
61+ shell : bash
5462 - name : Build ${{ matrix.lua }}
5563 run : |
5664 cargo build --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} --release --features ${{ matrix.lua }}
@@ -71,11 +79,21 @@ jobs:
7179 target : x86_64-apple-darwin
7280 - os : windows-latest
7381 target : x86_64-pc-windows-msvc
82+ - os : ubuntu-latest
83+ target : wasm32-unknown-emscripten
7484 steps :
7585 - uses : actions/checkout@v3
7686 - uses : dtolnay/rust-toolchain@stable
7787 with :
7888 target : ${{ matrix.target }}
89+ - name : Install emscripten (wasm32-unknown-emscripten)
90+ if : ${{ matrix.target == 'wasm32-unknown-emscripten' }}
91+ run : |
92+ sudo apt-get update -y
93+ sudo apt-get install -y --no-install-recommends emscripten
94+ echo 'CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node' >> $GITHUB_ENV
95+ echo 'RUSTFLAGS="-C link-args=-sERROR_ON_UNDEFINED_SYMBOLS=0"' >> $GITHUB_ENV
96+ shell : bash
7997 - name : Run ${{ matrix.lua }} tests
8098 run : |
8199 cargo test --manifest-path testcrate/Cargo.toml --release --features ${{ matrix.lua }}
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ impl Build {
104104 // Defined in Lua >= 5.3
105105 config. define ( "LUA_USE_WINDOWS" , None ) ;
106106 }
107+ _ if target. ends_with ( "emscripten" ) => {
108+ config. define ( "LUA_USE_POSIX" , None ) ;
109+ }
107110 _ => panic ! ( "don't know how to build Lua for {}" , target) ,
108111 } ;
109112
Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ extern "C" {
77 pub fn lua_tolstring ( state : * mut c_void , index : c_int , len : * mut c_long ) -> * const c_char ;
88 pub fn luaL_loadstring ( state : * mut c_void , s : * const c_char ) -> c_int ;
99
10- #[ cfg( any ( feature = "lua52" , feature = "lua53" , feature = "lua54" ) ) ]
10+ #[ cfg( feature = "lua52" ) ]
1111 pub fn lua_getglobal ( state : * mut c_void , k : * const c_char ) ;
12+ #[ cfg( any( feature = "lua53" , feature = "lua54" ) ) ]
13+ pub fn lua_getglobal ( state : * mut c_void , k : * const c_char ) -> c_int ;
1214}
1315
1416#[ cfg( feature = "lua51" ) ]
You can’t perform that action at this time.
0 commit comments