jeremyletang / rust-sfml

SFML bindings for Rust
Other
639 stars 88 forks source link

Enable statically linking on Windows MSVC #315

Closed 3119369616 closed 2 months 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

crumblingstatue commented 2 months ago

I don't have access to MSVC compiler, but if anyone is curious about testing the vendored-sfml branch with it, I would appreciate some reports. This branch should allow linking everything except OpenAL statically.