Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMerge static library
We not only can add source code files and also add some object(.o)/library(.a) files to the target directly for the api: add_files
It is different with another interface: add_links
- add_links:It only links library, .e.g -lxxxx and it's target is only binary program and share library.
- add_files:It will merge the static library into the target.
####Example
target("test")
-- create static library: libtest.a
set_kind("static")
-- add source files to the libtest.a
add_files("src/*.c")
-- add object files to the libtest.a
add_files("obj/*.o")
-- merge static librarys to the libtest.a
add_files("lib/*.a")And the target kind also can be binary or shared
target("test2")
-- create a shared library: libtest2.so
set_kind("shared")
-- add object files to the libtest2.so
add_files("obj/*.o")
-- merge libtest.a to the libtest2.so, but not link
add_files("lib/libtest.a")
-- add some source files
add_files("src/*.c")
Press h to open a hovercard with more details.