What clang option is equivalent to gcc -c -MMD x.cpp?

When I compile with g++ -MMD x.cpp, the x.o is accompanied by and x.d
containing the dependencies.

Does clang have a flag to enable this? I did try passing -MMD and,
base on the output of `clang --help` I did try -Xpreprocessor MMD;
however, neither worked.



clang++ -MMD x.cpp

should work in the same way. Does that not work for you? Which version
of Clang are you using, and do you get any error messages?

- Hans

Yes, it does now.

I don't know how I missed that. Maybe because my -o arg was in
a different directory, and I was checking the current directory.

Thanks Hans, and sorry for noise :frowning:

- Larry