Skip to content

Add object target kind to separate source files and compile flags  #263

@waruqi

Description

@waruqi

Separate compile flags

Only src/sub/*.c will be added -DBBB and -Ixxx flags.

target("demo")
    set_kind("binary")
    add_files("src/*.c")
    add_defines("AAA")
    add_deps("subfiles_with_other_flags")

target("subfiles_with_other_flags")
    set_kind("object")
    add_files("sub/*.c")
    add_defines("BBB")
    add_cxflags("-Ixxx")

Separate source files and generate the single target in different xmake.lua

./xmake.lua

target("demo")
    set_kind("binary")
    add_files("src/*.c")
    add_deps("subfiles")

./src/xmake.lua

target("subfiles")
    set_kind("object")
    add_files("sub/*.c")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions