From 0c1c266e65ede027addd1f18aa7714d225cfef42 Mon Sep 17 00:00:00 2001 From: yisibl Date: Wed, 2 Mar 2022 12:07:10 +0800 Subject: [PATCH] build(cargo): use lld for win x64 build --- .cargo/config.toml | 12 +++++++++++- .github/workflows/CI.yaml | 6 +++--- src/lib.rs | 6 ++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index eb0d042b..d66320ac 100755 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -12,4 +12,14 @@ rustflags = [ [target.aarch64-unknown-linux-musl] linker = "aarch64-linux-musl-gcc" -rustflags = ["-C", "target-feature=-crt-static"] +rustflags = ["-C","target-feature=-crt-static"] + +[target.x86_64-pc-windows-msvc] +linker = "rust-lld" + +[target.aarch64-pc-windows-msvc] +linker = "rust-lld" +rustflags = [ + "-Z", + "new-llvm-pass-manager=no", +] diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 74ca7d3f..5f32e6b2 100755 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -64,7 +64,7 @@ jobs: - host: macos-latest target: aarch64-apple-darwin build: | - yarn build --target=aarch64-apple-darwin + yarn build --target aarch64-apple-darwin strip -x *.node - host: ubuntu-latest architecture: x64 @@ -83,7 +83,7 @@ jobs: sudo apt-get update sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y build: | - yarn build --target=armv7-unknown-linux-gnueabihf + yarn build --target armv7-unknown-linux-gnueabihf arm-linux-gnueabihf-strip *.node - host: ubuntu-latest architecture: x64 @@ -223,7 +223,7 @@ jobs: - name: Build wasm run: yarn build:wasm - + - name: Test wasm run: yarn test:wasm diff --git a/src/lib.rs b/src/lib.rs index e4112815..3b3da314 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,13 +100,15 @@ impl Resvg { #[cfg(not(target_arch = "wasm32"))] #[napi(getter)] pub fn width(&self) -> f64 { - self.tree.svg_node().size.width() + dbg!(self.tree.svg_node().size.width()) + // self.tree.svg_node().size.width() } #[cfg(not(target_arch = "wasm32"))] #[napi(getter)] pub fn height(&self) -> f64 { - self.tree.svg_node().size.height() + dbg!(self.tree.svg_node().size.height()) + // self.tree.svg_node().size.height() } }