Skip to content
New issue

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

Export the given symbols list #2121

Closed
waruqi opened this issue Mar 2, 2022 · 0 comments
Closed

Export the given symbols list #2121

waruqi opened this issue Mar 2, 2022 · 0 comments

Comments

@waruqi
Copy link
Member

waruqi commented Mar 2, 2022

Support macosx (.dylib), windows (.dll), linux (.so). It will use *.def, version scripts .map/.ver and -export_symbols_list to export them automatically.

We can use it to reduce the size of the dynamic library and export only the symbols we need.

project example: https://github.com/xmake-io/xmake/tree/dev/tests/projects/c/shared_library_export_list

Export the given symbols list in xmake.lua

target("foo")
    set_kind("shared")
    add_files("src/foo.c")
    add_rules("utils.symbols.export_list", {symbols = {
        "add",
        "sub"}})

Export the given symbols list in *.export.txt file

target("foo2")
    set_kind("shared")
    add_files("src/foo.c")
    add_files("src/foo.export.txt")
    add_rules("utils.symbols.export_list")

Export all symbols

#1123 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant