【问题标题】:How to build a shared and a static library without recompiling the sources with CMake如何在不使用 CMake 重新编译源的情况下构建共享库和静态库
【发布时间】:2012-01-18 15:40:54
【问题描述】:

我想构建here 中描述的同一库的静态和共享版本。但是,源代码编译两次,每个版本编译一次,这不是必需的。 有什么方法可以避免这种情况?

【问题讨论】:

标签: compilation cmake shared-libraries static-libraries


【解决方案1】:

取决于平台。至少在 Linux 上,您需要使用不同的编译器标志来生成 position-independent(共享库)而不是普通(程序或静态库)代码。

【讨论】:

    猜你喜欢
    • 2012-10-05
    • 2018-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-10
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多