Compiling doesn't load textures, the code has no idea what size they are until the program is run by the end user.
The limit is determined based on the properties of the graphics card at run time. Different cards can have different limits, older cards might be 2048x2048 or lower, newer ones (like my RTX2080TI) are 32768x32768.