How to build a shared and a static library without recompiling the sources with CMake

别等时光非礼了梦想. 提交于 2019-12-11 08:18:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!