Avodah Zarah4: 6
עֲבוֹדָה זָרָה שֶׁהִנִּיחוּהָ עוֹבְדֶיהָ, בִּשְׁעַת שָׁלוֹם — מֻתֶּרֶת; בִּשְׁעַת מִלְחָמָה — אֲסוּרָה. בִּימוֹסְיָאוֹת שֶׁל מְלָכִים הֲרֵי אֵלּוּ מֻתָּרוֹת, מִפְּנֵי שֶׁמַּעֲמִידִין אוֹתָם בְּשָׁעָה שֶׁהַמְּלָכִים עוֹבְרִים.
An idol that was abandoned by its worshipers —- [if this occurred] in time of peace, it is permitted [for benefit]; in time of war, it is prohibited. Royal pedestals are permitted, because they erect them [only] when the kings pass.