Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Build libuv for Windows using GitHub Actions #180

Open
kroggen opened this issue Dec 18, 2020 · 2 comments
Open

Build libuv for Windows using GitHub Actions #180

kroggen opened this issue Dec 18, 2020 · 2 comments

Comments

@kroggen
Copy link

kroggen commented Dec 18, 2020

I am trying to build libuv for Windows using GItHub Actions, so it can be shared and anyone can use the workflow (and the binaries).

I was able to make it work but the DLL is depending on:

VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll

This can be avoided by compiling with /MT when using MSVC. I tried to do this with CMake but no much success. There are some notes here:

https://stackoverflow.com/questions/14172856/compile-with-mt-instead-of-md-using-cmake

Also, the build for Windows 32-bit failed with:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(358,5):
error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|Win32. 

If you have interest on this, the repo is here on branch cmake. There is also a build branch for a build attempt without cmake.

@kroggen
Copy link
Author

kroggen commented Dec 18, 2020

By the way, why is it so hard to get binaries for Windows?

You do not have an idea of how many hours (spanning many days!!!) we waste trying to just get a f**ing updated libuv DLL for Windows without those trash dependencies

@kroggen
Copy link
Author

kroggen commented Dec 19, 2020

OK, I was able to fix the dependencies using this block before the add_library on CMakeLists.txt:

if(MSVC)
  add_compile_options(
      $<$<CONFIG:>:/MT>
      $<$<CONFIG:Debug>:/MTd>
      $<$<CONFIG:Release>:/MT>
  )
endif()

Now just lacking a method to compile libuv for Windows 32-bit (not high priority though)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant