I've got a list of object files that I want to package in a library. How do I do this? I thought I could use ADD_LIBRARY
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
add_library
is the correct answer. To make a static library, you want to do something like this:
add_library(foo STATIC foo.c bar.c baz.c)
回答2:
Static libraries are becoming a bit obsolete, but "ar" is the command you are looking for.