girepository: Fix static build under Windows
Properly define GI_STATIC_COMPILATION
when static build is enabled.
Use library()
instead of shared_library()
to allow selecting static builds.
Note: this also helps WebAssembly, which currently lacks support for shared libraries.