On Windows, you can include the icon in the executable yourself. There are programs that add resources to a file. This is not a compiler that adds resources.
On Linux, this is not done in the executable itself. There was an earlier answer to here
source share