-
Notifications
You must be signed in to change notification settings - Fork 455
building for windows with dependencies #1535
-
I'm sorry if this is a basic easy question, but I've been fighting with this for 3 days and I just cannot figure out how to do this ( it feels like it's not a "cross" problem, but a "understanding cargo build" problem, but ....
I have a project in rust, I have setup a build script that compiles for 10 different targets (linux, macos, windows)
It works perfect ( thank you so much for this project !!! it's a life saver )
But now i need to use napi-rs ... that works fine on all targets except windows. ( if i go to a windows machine with nodejs and visual studio installed rust compiles without any issues ) But with cross, it fails with
= note: x86_64-w64-mingw32-gcc-posix: error: delayimp.lib: No such file or directory
x86_64-w64-mingw32-gcc-posix: error: /DELAYLOAD:node.exe: No such file or directory
I assumed i need to find those files and "map" them into cross by adding a
[build.env]
volumes = [ ]
section but from here I'm lost ... I tried extracting a windows nodejs installation and the folder containing delayimp.lib from a windows machine with visual studio installed, but it's like rust does not find them.
I guess my question is.
If we have dependencies, we can easily add those using something like
[build]
pre-build = [
"apt-get update && apt-get install --assume-yes protobuf-compiler"
]
but this only works for linux. Is there a way to easily add things to the wine installation, when building for windows ?
How do we add dependencies for/on windows ?
Has anyone else tried making cross work with the napi-build/napi crates on windows ?
Beta Was this translation helpful? Give feedback.
All reactions
Try using their alpha release which includes napi-rs/napi-rs#2026
Replies: 1 comment 1 reply
-
Try using their alpha release which includes napi-rs/napi-rs#2026
Beta Was this translation helpful? Give feedback.
All reactions
-
oh my god, i feel stupid.
So i had already tested using the alpha , but i was using napi-build = "1" ... as soon as i "bumped" that up to napi-build = "2.1.3" it started working on all my targets.
Beta Was this translation helpful? Give feedback.