I need to pass a compiler flag -D__DEBUG_FILE__="src.cpp"
to g++ while compiling source file src.cpp. How can I achieve this in meson? I am aware of the cpp_args
built-in option, but not able to figure out how to pass the file name in it.
I am aware that in make file you can write similar to below to achieve this: I am looking for a way to replicate this in meson build.
test.o : test.cpp
g++ -D__MY_FILE__=\"$<\" -c $< -o $@