diff --git a/.github/workflows/build-revive-wasm.yml b/.github/workflows/build-revive-wasm.yml index 92a3d03..e70d0f4 100644 --- a/.github/workflows/build-revive-wasm.yml +++ b/.github/workflows/build-revive-wasm.yml @@ -32,7 +32,7 @@ jobs: - name: Install LLVM Dependencies if: steps.cache-llvm.outputs.cache-hit != 'true' run: | - sudo apt-get update && sudo apt-get install -y cmake ninja-build libncurses5 libtinfo-dev libtinfo5 + sudo apt-get update && sudo apt-get install -y cmake ninja-build libncurses5 # Install Emscripten git clone https://github.com/emscripten-core/emsdk.git cd emsdk diff --git a/README.md b/README.md index 8165f3d..1151ab9 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,13 @@ Install [emscripten](https://emscripten.org/docs/getting_started/downloads.html) To build resolc.js execute: ```bash +bash build-llvm.sh +export PATH=${PWD}/llvm18.0/bin:$PATH export EMSDK_ROOT= bash emscripten-build-llvm.sh source $EMSDK_ROOT/emsdk_env.sh export LLVM_LINK_PREFIX=${PWD}/llvm18.0-emscripten +export PATH=$PATH:$PWD/llvm18.0-emscripten/bin/ make install-wasm ``` diff --git a/crates/lld-sys/build.rs b/crates/lld-sys/build.rs index e8f7b00..28e7f87 100644 --- a/crates/lld-sys/build.rs +++ b/crates/lld-sys/build.rs @@ -86,8 +86,8 @@ fn set_rustc_link_flags(llvm_config_path: &Path) { println!("cargo:rustc-link-lib=static={lib}"); } - #[cfg(target_os = "linux")] - { + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); + if target_os == "linux" { println!("cargo:rustc-link-lib=dylib=stdc++"); println!("cargo:rustc-link-lib=tinfo"); }