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")
Separate compile flags
Only
src/sub/*.cwill be added-DBBBand-Ixxxflags.Separate source files and generate the single target in different xmake.lua
./xmake.lua
./src/xmake.lua