-
Add_links: Only links can be added, such as - lxxxx. Links can only target executable programs and dynamic libraries, and only link the required code -
Add_files: directly unpack and repackage all object files in the static library into a new target, which can be a new static library, an executable program, or a dynamic library
add_target("test") --Generate static library: libtest. a set_kind("static") --Add Object File add_files("obj/*.o") --Add a static library, repackage the object files in it to libtest. a, and generate a new static library add_files("lib/*.a")
add_target("test2") --Generate dynamic library: libtest2.so set_kind("shared") --Add Object File add_files("obj/*.o") --Add all object files in the static library libtest. a add_files("lib/libtest.a") --Add some source files add_files("src/*.c")