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

Improve package dependences #1178

Closed
waruqi opened this issue Jan 2, 2021 · 2 comments
Closed

Improve package dependences #1178

waruqi opened this issue Jan 2, 2021 · 2 comments

Comments

@waruqi
Copy link
Member

waruqi commented Jan 2, 2021

  • add add_requireconfs() to rewrite package/deps configs

for example: https://github.com/xmake-io/xmake/blob/deps/tests/projects/package/depconfigs/xmake.lua

add_requires("libpng", "libtiff", {system = false, configs = {vs_runtime = "MD"}})
add_requires("libwebp")

add_requireconfs("libwebp",            {system = false, configs = {shared = true, vs_runtime = "MD"}})
add_requireconfs("libpng.zlib",        {system = false, configs = {cxflags = "-DTEST1"}, version = "1.2.10"})
add_requireconfs("libtiff.*|cmake",    {system = false, configs = {cxflags = "-DTEST2"}})
add_requireconfs("libwebp.**|cmake",   {system = false, configs = {cxflags = "-DTEST3"}})

pr:
#1175

@waruqi
Copy link
Member Author

waruqi commented Jan 4, 2021

and the configs of add_requires have a higher priority than add_requireconfs.

for example:

    -- foo and bar will be debug mode
    add_requireconfs("*", {configs = {debug = false}})
    add_requires("foo", "bar", {configs = {debug = true}})

@waruqi
Copy link
Member Author

waruqi commented Jan 5, 2021

we can also override the configs of add_requires

add_requires("zlib 1.2.11")
add_requireconfs("zlib", {override = true, version = "1.2.10"})

we override the version of zlib to 1.2.10

@waruqi waruqi closed this as completed Jan 8, 2021
@waruqi waruqi pinned this issue Jan 8, 2021
@waruqi waruqi unpinned this issue Feb 27, 2021
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