Skip to content

Commit

Permalink
Improved search path and README for libymfm.a links (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
h1romas4 committed Jan 24, 2024
1 parent 9aea8be commit bf61609
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
export WASI_SDK_PATH=$(pwd)/wasi-sdk-19.0
export CARGO_TARGET_WASM32_WASI_LINKER=${WASI_SDK_PATH}/bin/lld
export CARGO_TARGET_WASM32_WASI_RUSTFLAGS="-L ${WASI_SDK_PATH}/share/wasi-sysroot/lib/wasm32-wasi"
(mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/wasi.cmake .. && make -j4)
cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/wasi.cmake -S . -B build
cmake --build build --parallel $(nproc)
cargo +nightly build --release --target wasm32-wasi --features bindgen
ls -laF target/wasm32-wasi/release/
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,8 @@ cd libymfm.wasm
### Build C/C++ (ymfm)

```bash
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/wasi.cmake ..
make -j4
cd ..
cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/wasi.cmake -S . -B build
cmake --build build --parallel $(nproc)
ls -laF dist/ | grep libymfm
-rw-rw-r-- 1 hiromasa hiromasa 480942 5月 25 13:21 libymfm.a
```
Expand Down
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::env;

fn main() {
// export LD_LIBRARY_PATH=$(pwd)/dist
println!("cargo:rustc-link-search=native=./dist");
let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
println!("cargo:rustc-link-search=native={}/dist", dir);
}

0 comments on commit bf61609

Please sign in to comment.