coin3d / simage

Image file loading
ISC License
7 stars 9 forks source link

Link FLAC when static linking with libsndfile #39

Closed rickertm closed 4 years ago

rickertm commented 4 years ago

Linking against a static libsndfile with FLAC option requires linking against libFLAC:

/usr/bin/ld: libsndfile.a(flac.c.o): in function `sf_flac_meta_get_vorbiscomments':
undefined reference to `FLAC__metadata_object_vorbiscomment_find_entry_from'
/usr/bin/ld: libsndfile.a(flac.c.o): in function `sf_flac_error_callback':
undefined reference to `FLAC__StreamDecoderErrorStatusString'

This PR fixes this by adding a CMake find script for FLAC and links against libFLAC when libsndfile support is enabled and the FLAC library was found.