glib: add option for static library creation

Closes #25505.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>