HiRoFa / quickjs-sys

Low level rust bindings for quickjs, quickjs-ng
MIT License
4 stars 2 forks source link

How to build on windows 10 #1

Open Naginipython opened 2 months ago

Naginipython commented 2 months ago

I am trying to use the quickjs_runtime crate in my project, and it works really well on linux (best I've used), but when I try to build for windows, the custom script for this fails. I tried to get GCC, since it stdout mentioned it, but to no avail.

error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Z7" "-Brepro" "-W4" "-D_GNU_SOURCE" "-DCONFIG_VERSION=\"quickjs-ng-0.4.1\"" "-DCONFIG_BIGNUM" "-FoD:\\Documents\\GitHub\\js_rs_test\\target\\debug\\build\\hirofa-quickjs-sys-3ca1b89090c2287e\\out\\04a782c76559f00c-cutils.o" "-c" "D:\\Documents\\GitHub\\js_rs_test\\target\\debug\\build\\hirofa-quickjs-sys-3ca1b89090c2287e\\out\\quickjs\\cutils.c" with args cl.exe did not execute successfully (status code exit code: 2).

I can post full stderr if needed, but there is a lot there. Is there a C/C++ build step on Windows I'm unaware of?

andrieshiemstra commented 2 months ago

Hi Naginipython,

I don't do anything on windows but afaik msvc doesn't work. can you use mingW?

See also https://github.com/HiRoFa/quickjs_es_runtime/issues/45 and maybe https://github.com/HiRoFa/quickjs_es_runtime/blob/master/.github/workflows/rust.yml#L27

Naginipython commented 2 months ago

Thanks for the info! I didn't know much about swapping C compilers in rust, and didn't quite understand for a minute. I got it working, with the stable-x86_64-pc-windows-gnu toolchain, but am now in a pickle since Tauri needs MSVC, but quickjs_runtime needs GNU. Tough.

andrieshiemstra commented 2 months ago

Ah yes, I see..

I'm working on updating the embedded quickjs-ng to 0.5.0 and then check if I can compile with msvc using their makefile. if so I'll see if i can update the script (or maybe even just use their makefile)

No promises...