Create an object of the shape you need using boolean union operation and wrap it in a frame. Set this frame to an absolute position. Also set the correct constraints and apply the boolean property to the object in the union.
I don’t know what other recommendations can be given when you created a component according to my example. I can only suggest considering the possibility of making separate shape components (rounded, squared, etc.), inserting an instance of one of them into a component with an icon. This way you will reduce the number of variants of the component with the icon, because you have excluded the variants of the other shape.
In general, you need to independently consider the various methods and choose the best ones for you.