How to specify imported dependencies of an OBJECT library?

前端 未结 1 692
半阙折子戏
半阙折子戏 2020-12-15 04:24

I have an OBJECT library objlib which is linked into the main target maintarget. The objlib has a dependent library, say,

相关标签:
1条回答
  • 2020-12-15 05:06

    As of CMake 3.12, you can now use target_link_libraries on object libraries to get usage requirements.

    Using 3.12, this approach that you mentioned should work:

    add_library(objlib OBJECT ...)
    target_link_libraries(objlib ZLIB::ZLIB)
    
    0 讨论(0)
提交回复
热议问题