I've written a chess program for Windows in C++, and am interested in porting it to macOS. I have a variety of questions on how to go about this. I'll start with the question of how to set up the project.
My intention, roughly speaking, is to have a directory of all the Windows-specific code, one of just macOS-specific code, and one of the C++ back end that both operating systems will call into. If possible, I would like to keep all this code in a single project, selecting the desired front end code with pound defines and tracking it with a single Git repository, since the parts don't mean much one their own. Is there a way to do this that would play nicely with Git and the built-in Git support of Xcode and Visual Studio, respectively? At least with default settings, Visual Studio's Git support uploads the entire solution, which is to say, my code wrapped in and interspersed with a bunch of auto-generated IDE-specific stuff. I assume I couldn't simply import that whole mess into Xcode, where I'd end up with source wrapped in Visual studio stuff wrapped in Xcode stuff. Is using multiple repositories the way this is always done?