Ibn 'Umar (May Allah be pleased with them) said:
I heard a man saying: "No, by the Ka'bah." I admonished him: "Do not swear by any thing besides Allah, for I heard the Messenger of Allah (ﷺ) saying, 'He who swears by anyone or anything other than Allah, has indeed committed an act of Kufr or Shirk'."[At- Tirmidhi].[Some 'Ulama' are of the opinion that the words of the Prophet (ﷺ) that "He who swears by anyone or anything other than Allah has indeed committed an act of Kufr or Shirk," are in the nature of extreme admonition. And in fact, it is not Shirk. The same applies to the saying of the Prophet (ﷺ), who said, "showing off is Shirk."]
App reference: Book 18, Hadith 201
Arabic/English book reference: Book 18, Hadith 1711