PistonDevelopers / freetype-sys

Low level bindings for the FreeType font library
MIT License
29 stars 42 forks source link

Support static linking against FreeType #12

Open alexchandel opened 9 years ago

alexchandel commented 9 years ago

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.

bvssvni commented 9 years ago

+1

bvssvni commented 9 years ago

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

mbrubeck commented 9 years ago

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

alexchandel commented 9 years ago

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

bvssvni commented 9 years ago

Statically linking by default is fine for me.

Potpourri commented 9 years ago

This is still relevant?

bvssvni commented 9 years ago

I believe so.

retep998 commented 9 years ago

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.