Projucer unexpected cross-platform behavior, breaking Xcode build

EDIT: Previously I had said that the Xcode project breaks after using the ‘Save and Open in IDE’ step in Windows Projucer. That step isn’t actually necessary - as soon as I save the Projucer file in Windows, the Xcode project breaks.

Summary: Saving a Projucer file in Windows 10 causes the Xcode project build to break, because it modifies the file MyPlugin/Builds/MacOSX/MyPlugin.xcodeproj/project.pbxproj

OK, not sure if this is an error in my setup, or a Projucer bug. I am working on a plug-in on a Mac system, and doing Windows builds with VMWare running Windows 10. The same project directory is shared between the two platforms (via VMWare’s “Shared Folders” feature).

  1. I successfully build the plug-in on the Mac side.
  2. I switch over to the Windows VM, open Projucer there, and re-save the Projucer project file.
  3. I switch back to Mac, and try to build the plug-in again. It can’t find needed Juce headers, and the build fails.

Comparing before and after running Windows Projucer, the only file that is changed is MyPlugin/Builds/MacOSX/MyPlugin.xcodeproj/project.pbxproj.

So, for starters… why would the Windows Projucer be touching anything inside MyPlugin/Builds/MacOSX/?

Perhaps this is the answer, from the Projucer manual:

All export targets (which are the native IDE projects) are generated when you create your Projucer project. They are also updated every time you save it in the Projucer.

So, when I save the Projucer project in Windows, it is supposed to go ahead and re-generate the Mac export targets as well? In other words, this is expected behavior?

Which means that the Global Paths (which are stored and saved separately on the two systems) have to be set, not only for the system I’m on, but also for the other system as well? E.g. on the Mac side, I have to copy over the Global Paths for Windows?

I’m not able to test that at the moment, but I suspect that is the rub. Seems counter-intuitive to me to allow the Windows dev environment to modify the contents of MyPlugin/Builds/MacOSX/, but oh well.

When you save the project the entire Builds folder is regenerated, otherwise the IDE projects would be out of step with the Projucer project. If you’ve set the module paths explicitly in the module settings page then these paths will be used otherwise it will use the global paths that you have set via Projucer->Global Paths.... There is a drop-down at the top of this window for each platform so you can set the paths for macOS and your Windows VM differently to match the OS, then when you save the paths will be correct.

Thanks Ed - yes, confirmed that setting the global paths for Windows within the Mac version of Projucer (and vice-versa) fixed the issue.

I see the virtue in keeping the IDE projects always in step with the Projucer project. It was still unexpected behavior (in an intuitive sense) to have the Windows Projucer meddling with the Xcode project. I just had to shift my thinking of Projucer’s role a bit… And since Projucer is the cross-platform project manager, I can actually just go ahead and trash Projucer within the Windows VM, and only run Projucer from Mac (to manage both sides). That will prevent possible future confusion if I change Projucer’s Global Paths on the Mac side, but forget to paste in the same changes over on the Win side.