jeremyletang / rust-sfml

SFML bindings for Rust
Other
634 stars 88 forks source link

Enable statically linking on Windows MSVC #315

Open 3119369616 opened 1 year ago

3119369616 commented 1 year ago

Description

Prefer linking static libraries (except OpenAL32.dll) on Windows MSVC toolchain.

Library dependency:

sfml-audio-s.lib >------------------------------------+--> openal32.lib >--+--> flac.lib
                                                      |                    ↓
                                                      |                    +--> ogg.lib --> vorbis.lib >--+--> vorbisfile.lib
                                                      |                                                   ↓
                                                      ↓                                                   +--> vorbisenc.lib
sfml-network-s.lib >--+-------------------------------+
                      ↓                               |
                      +--> ws2_32.lib (Windows)       |    
                                                      ↓
sfml-graphics-s.lib >--+--> sfml-window-s.lib >-------+--> sfml-system-s.lib --> winmm.lib (Windows)
                       |                              ↓
                       +--> opengl32.lib (Windows)    +--> gdi32.lib (Windows)
                                                      ↓
                                                      +--> freetype.lib
NuriYuri commented 1 year ago

Hi, it kind of duplicate with (different problem but conceptually the same issue): https://github.com/jeremyletang/rust-sfml/issues/296

I've tried using the SFML_STATIC environment variable and it doesn't build. The reason is stated here: https://en.sfml-dev.org/forums/index.php?topic=13908.0