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 ?
I want to build both a static and shared version of the same library
Share
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.