Skip to content

Commit

Permalink
build(cargo): use lld for win x64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
yisibl committed Mar 2, 2022
1 parent 6d4133a commit 0c1c266
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 11 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
6 changes: 3 additions & 3 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:

- name: Build wasm
run: yarn build:wasm

- name: Test wasm
run: yarn test:wasm

Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 0c1c266

Please sign in to comment.