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

Support `private, public, interface` to improve dependency inheritance like cmake #368

Closed
waruqi opened this Issue Mar 7, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@waruqi
Copy link
Member

waruqi commented Mar 7, 2019

Inherit all compiler and linker settings, e.g. add_cflags, add_defines, add_includedirs ..

Roadmap

  • add_xxx("", {public = true})
    • private = true (default)
    • public = true (private + public)
    • interface = true (only public)
  • add_deps("", {inherit = false})
    • inherit = true (default)
  • target:get("defines", {interface = true})
  • target:add("defines", "xxx", {public = true})
  • target:set("defines", "xxx", {private = true})

References

#291

Examples

target("test")
    set_kind("static")
    add_files("src/*.c")
    add_includedirs("inc", {public = true})

-- inherit includedirs and link libtest.a
target("demo")
    set_kind("binary")
    add_deps("test") 

-- only affect the compilation order 
target("demo2")
    set_kind("binary")
    add_deps("test", {inherit = false})
@orzuk-lmj

This comment has been minimized.

Copy link
Contributor

orzuk-lmj commented Mar 7, 2019

可以也實作這種語法嗎?

target:add("xxx", "yyy", {public = true})
@waruqi

This comment has been minimized.

Copy link
Member Author

waruqi commented Mar 7, 2019

可以也實作這種語法嗎?

target:add("xxx", "yyy", {public = true})

yes

@waruqi

This comment has been minimized.

Copy link
Member Author

waruqi commented Mar 9, 2019

I have implemented this feature in dev branch.

@waruqi waruqi closed this Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.