We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
target("test") set_kind("static") add_files("src/*.a")
It does not support merging archive libraries containing .o files with the same name. And it is very inconvenient to merge dependent target libraries.
we use set_policy("build.merge_archive", true) to enable merge archive intead of linking for all dependent targets.
set_policy("build.merge_archive", true)
target("add") set_kind("static") add_files("src/add.c") target("sub") set_kind("static") add_files("src/sub.c") target("mul") set_kind("static") add_deps("add", "sub") add_files("src/mul.c") set_policy("build.merge_archive", true)
we can also call module script to merge static library.
target("test") after_link(function (target) import("utils.archive.merge_staticlib") merge_staticlib(target, "libout.a", {"libfoo.a", "libbar.a"}) end)
The text was updated successfully, but these errors were encountered:
What advantages are there to merge static libraries? Is it supported by all toolchains?
Sorry, something went wrong.
Some users only want to distribute a single static library externally, they don't want to provide too many static libraries.
Currently supports ar and msvc/lib.exe, and should be able to support most toolchains.
No branches or pull requests
old solution
It does not support merging archive libraries containing .o files with the same name. And it is very inconvenient to merge dependent target libraries.
new solution
we use
set_policy("build.merge_archive", true)
to enable merge archive intead of linking for all dependent targets.we can also call module script to merge static library.
The text was updated successfully, but these errors were encountered: