Skip to content

Prebuilt-Libs Windows - Which one should we link with? #35

@coderedart

Description

@coderedart

So, the official binaries provided by glfw have the following directories:

  • lib-mingw-w64/
    • glfw3.dll
    • libglfw3dll.a
    • libglfw3.a
  • lib-static-ucrt/
    • glfw3.dll
    • glfw3dll.lib
  • lib-vc20XX/ (replace XX with visual studio versions)
    • glfw3.dll
    • glfw3dll.lib
    • glfw3.lib
    • glfw3_mt.lib

For now, with prebuilt_libs feature, we just link lib-vc2022/glfw3.lib for static and lib-vc2022/glfw3dll.lib for dynamic linking. I honestly don't know if that's the right choice, so, I hope someone familiar with windows can tell me if I am doing something wrong.

Our CI workflow tests this with MSVC. But #22 talks about issues (with source builds using cmake) if used with clang, so, maybe we should test that in CI too?

Here's my current understanding:
Obviously dll is for dynamic linking and lib is for static linking glfw. The rest is about whether ucrt (universal c runtime) is linked statically or dynamically. (/MT or /MD )

  • lib-static-ucrt/glfw3.dll - statically linked ucrt /MT.
  • lib-vc20xx/glfw3.dll - dynamically linked ucrt /MD.
  • lib-vc20xx/glfw3_mt.lib - statically linked ucrt /MT.
  • lib-vc20xx/glfw3.lib - dynamically linked ucrt /MD.
  • lib-mingw-w64 - for mingw toolchain on windows to build for windows. (lets just ignore this until someone needs this)

I guess the question is, how do we want to link ucrt? This question also applies to source builds (cmake::Config::static_crt).

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions