بِسْــــــــــــــــــمِ اﷲِالرَّحْمَنِ اارَّحِيم
The truth is that the mosque was set on the basis of piety, since the first day is more worthy of your prayers. Inside the mosque there are people who want to clean themselves. And verily, Allah loves those who are clean.
So if the people who founded the mosque on the foundation of pious to Allah and His good pleasure is good, or the people who built the building on the brink of collapse, then the building fell with him into Hell. And God does not give instructions to people who do wrong.
At Taubah : 108 - 109