Reputation: 15715
I want to build both a static and shared version of the same library as described here. However, the sources are compiled twice, one for each version which is not necessary. Any ways of avoiding this ?
Upvotes: 1
Views: 592
Reputation: 363587
Depends on the platform. On Linux at least, you need to use different compiler flags to produce position-independent (shared library) than ordinary (program or static library) code.
Upvotes: 2