freetype-sys icon indicating copy to clipboard operation
freetype-sys copied to clipboard

Support static linking against FreeType

Open alexchandel opened this issue 10 years ago • 8 comments

Static linking against FreeType is possible, and FreeType supplies a static form, libfreetype.a. It should be possible to link against this instead of the dynamic library.

alexchandel avatar Jan 16 '15 03:01 alexchandel

+1

bvssvni avatar Jan 17 '15 14:01 bvssvni

Are there any other -sys libraries that supports both static and dynamical linking which we could use for reference?

bvssvni avatar Feb 04 '15 12:02 bvssvni

openssl-sys uses static or dynamic linking depending on the target, but it could be done based on other configuration info instead:

https://github.com/sfackler/rust-openssl/blob/7b8aa9b9153ba4da4069bafbc3d0d4b476f25f9c/openssl-sys/build.rs#L18-L22

mbrubeck avatar Feb 04 '15 17:02 mbrubeck

I imagine we'd default to static, and switch dynamic if that wasn't available or if prefer-dynamic was passed.

alexchandel avatar Feb 04 '15 22:02 alexchandel

Statically linking by default is fine for me.

bvssvni avatar Feb 05 '15 13:02 bvssvni

This is still relevant?

Potpourri avatar Feb 14 '15 11:02 Potpourri

I believe so.

bvssvni avatar Feb 14 '15 12:02 bvssvni

Static linking should just work fine already on Windows if you have a static version of freetype and specify that as the library name instead of the dynamic version.

retep998 avatar Oct 08 '15 22:10 retep998