mmh. cflags and cxxflags are command line options ? i would expect them to be defined as part of build file.
target("test")
set_kind("binary")
add_files("src/*.c", "src/*.cpp")
add_cflags("-fPIC", "-Dxxx")
add_cxxflags("-fPIC", "-Dxxx")
The command line arguments just give you a quick and easy way to modify cflags.