Bug 268441

Summary: [patch] fix for building static C bindings
Product: [Unmaintained] taglib Reporter: mabrand
Component: generalAssignee: Scott Wheeler <wheeler>
Status: RESOLVED FIXED    
Severity: normal CC: lalinsky
Priority: NOR    
Version First Reported In: 1.7   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: fix for building static C bindings

Description mabrand 2011-03-14 09:33:11 UTC
Created attachment 57953 [details]
 fix for building static C bindings

Version:           1.7
OS:                All

Support for ENABLE_STATIC didn't seem to be completely implemented for the C bindings. The attached patch seems to help. Used in mingw-cross-env.

Reproducible: Didn't try
Comment 1 Lukáš Lalinský 2011-03-14 11:23:18 UTC
The reason why this wasn't done in the first place is that once you do this, you have to link the C bindings against the C+++ runtime libraries, which I thought was kind of pointless. If you think that's not a problem, I'll apply the patch.
Comment 2 mabrand 2011-03-14 11:41:10 UTC
Unless I'm misunderstanding something, it is just a general characteristic of static linking that underlying libraries have to be linked to at build-time. The fact that the underlying library is written in C++ does not seem to me to introduce any new considerations. Someone using the C bindings and static linking shouldn't be surprised by this.
Comment 3 mabrand 2011-03-14 11:42:52 UTC
By the way, I wasn't sure if this line is still necessary or what it does:

set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
Comment 4 Lukáš Lalinský 2011-03-19 08:31:39 UTC
Thank you, fixed in https://github.com/taglib/taglib/commit/8f42d5b5

Yes, that line is still necessary, it tells the main TagLib library to not "dllimport" the symbols.