I have read this in an essay titled Mahipatis -1774 a translation of a Marathi poem Bhaktaliamrit which was published in 1773. I cannot find any verification anywhere else of what this poem says about Guru Nanak.
In essence it says that Guru Nanak had a great fortune and he felt that this wealth was a hindrance in his search for God. So in order to spend this money he started building Temples but the Muslim rulers of the time did not like it and had the temples pulled down. Then the Guru thought that mosques are also the house of God so he started building mosques but then all his Hindu friends and followers objected to his new venture. So the Guru thought let me do something which will be pleasing both to the Hindus and the Muslims. So the Guru desisted from making temples and mosques and he started building privies or toilets. People laughed at him but eventually appreciated the numerous privies when they were used both by the Hindus and the Muslims. – This essay can be found in a Punjab University Publication Bureau book titled Guru Nanak in The Eyes of Non-Sikhs compiled and edited by Sarjit Singh Bal. The first edition is dated November 1969.