Mac os x, gcc-6 compile error

I do not think gcc (even 6) can build Cocoa back-end on macOS/work with Apple’s framewors. So maybe there is a problem with cmake (what is is negative -O ??), but I think you anyway have to disable Cocoa in the first place (before it was --disable-cocoa, not sure how you do this nowadays).