Skip to content

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

@waruqi

Description

@waruqi

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})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions