问题
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 ?
回答1:
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.
来源:https://stackoverflow.com/questions/8912938/how-to-build-a-shared-and-a-static-library-without-recompiling-the-sources-with