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

Add includes and links from target deps automatically #87

Closed
waruqi opened this Issue May 12, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@waruqi
Member

waruqi commented May 12, 2017

xmake (dev) will add includedirs, links, linkdirs and rpathdirs to target automatically if it's target deps is static/shared library.

Before:

target("library1")
    set_kind("static")
    add_files("*.c")
    add_headers("inc1/*.h")

target("library2")
    set_kind("static")
    add_deps("library1")
    add_files("*.c")
    add_headers("inc2/*.h")
    add_includes("$(buildir)/inc1")

target("test")
    set_kind("binary")
    add_deps("library2")
    add_includes("$(buildirs)/inc2")
    add_links("library2", "library1")
    add_linkdirs("$(buildir)")

Now:

target("library1")
    set_kind("static")
    add_files("*.c")
    add_headers("inc1/*.h")

target("library2")
    set_kind("static")
    add_deps("library1")
    add_files("*.c")
    add_headers("inc2/*.h")

target("test")
    set_kind("binary")
    add_deps("library2")
@TitanSnow

This comment has been minimized.

Show comment
Hide comment
@TitanSnow

TitanSnow May 12, 2017

Contributor

This makes me recall Cascading Style Sheets 👍

But, better to have a way to let users disable inheriting. To use or not use a feature should be decided by users

*{all:initial;}
Contributor

TitanSnow commented May 12, 2017

This makes me recall Cascading Style Sheets 👍

But, better to have a way to let users disable inheriting. To use or not use a feature should be decided by users

*{all:initial;}
@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi May 12, 2017

Member

@TitanSnow ok, I will consider it

Member

waruqi commented May 12, 2017

@TitanSnow ok, I will consider it

@waruqi waruqi added the improvement label Jun 2, 2017

@waruqi waruqi added this to the v2.1.5 milestone Jun 3, 2017

@waruqi waruqi closed this Aug 2, 2017

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 16, 2017

Member

We can also set inherit attribute to disable the default inheritance behavior in v2.1.6

add_deps("dep1", "dep2", {inherit = false})
Member

waruqi commented Aug 16, 2017

We can also set inherit attribute to disable the default inheritance behavior in v2.1.6

add_deps("dep1", "dep2", {inherit = false})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment