Closed arm32x closed 2 years ago
Thank you, I'll take a closer look tomorrow!
Well.... This requires static libraries for all SFML deps to be present on the system, which is not the case on most systems, and sounds like a pain to prepare for the average user.
But since this doesn't affect dynamically linked SFML, I'm accepting this pull request.
This pull request adds support for statically linking SFML for Windows (MSVC) and Linux, which can be activated by setting the
SFML_STATIC
environment variable.This works by linking all dependencies of SFML into
rust-sfml
, which is the correct way to do static linking according to the SFML FAQ.I have used this successfully to build statically-linked executables for the
x86_64-pc-windows-msvc
andx86_64-unknown-linux-gnu
targets. No other targets have been tested and are not likely to work without further changes.On Linux, SFML must be built from source with the
BUILD_SHARED_LIBS
CMake option set to false, since most SFML packages do not include static libraries.