Camillo Sitte studied the siting of churches in Italy and determined that, in Rome at least, most of them shared at least one wall with secular buildings, and some shared all at least parts of all four walls. Here is an example of a few houses built right up against a huge church.
Purists may object, and these houses are fairly dilapidated, but I think they do the church no harm. I don't suppose they would be an addition to the main façade, but here on the back side they are fine.
City Design Home