Go to Options -> Paths and replace the default temporary directory with one of your choosing.
I think there was a discussion similar to this, possibly on Info-LabVIEW, a while back. The Mac, like Linux, allows much longer file paths but builds were failing at a temporary path which exceeded the lengths you had trouble with. It always seemed to occur on "buried" files and folders which no one ever sees or cares about.
I do not recall that anything other than the crude, awkward, and not certain to work work-around you are using was proposed. The suggestion that NI should assure that builds always work if the project path length was within OS limits did not get much traction.