Fix building frameworks on MacOS