The cc -x xxx option is supposed to be positional, not global.
For example: cc foo.c -x c++ foo1.p -x foo2.p
This is something that can not be easily fixed with the way that the ld/cc wrapper is currently implemented.