Add ability to build iOS and macOS frameworks with nonfree modules (#13424) * Allow building ios framework with nonfree * Allow building osx framework with nonfree