Our rule was the code most compile w/o warnings on 3 dissimilar platforms before you could commit it. We were able to do this easily because we had network-mounted home directories, so when you logged into another machine, our development tree was automatically mounted. This made it easy to compile without checking in, then checking out.
You test your changes on all the various platforms by pushing it to the try server, it compiles on the various platforms we have set up at the moment (FBSD, Mac OS X, Windows, Ubuntu Linux) and gives you a status report on what if anything broke. If nothing is broken you can push it out to Review Board, at which point someone reviews the code.
Once the code has been reviewed and ship-it has been tagged on RB, the code is checked into subversion proper. At this time the buildbot picks up the change and does a quick (svn update) build to make sure nothing was broken, and then does a full (rm -rf buildir; svn co) build at the top of the hour.
Reports get mailed, code is checked in.
Yuck. Here's how we do it:
The commit shows up in gerrit for code review. Immediately the buildbots (one for each platform) notice the change and attempt to compile it. The results are reported back to gerrit and a failed compile blocks the change from being submitted.Assuming the change compiles cleanly and passes code review, it can then merged to the master branch. Importantly, broken code doesn't get checked-in in the first place.
Now, we happen to use git and gerrit and buildbot, but any decent system should have code review and a build farm that allow changes to be tested and reviewed before they are checked in.
If your developers aren't following some procedure (e.g., test compile on every platform), consider it may be because there is too much friction. Instead of firing the developers, ask why they aren't following it. Maybe other developers are impacted too and just have a higher tolerance for menial tasks, but those tasks are still costing the organization.
http://code.google.com/p/gerrit/
http://buildbot.net/trac
http://github.com/jaysoffian/buildbot/commit/e4c0d458374b9a0...
And if you happen to use hudson:
http://wiki.hudson-ci.org/display/HUDSON/Gerrit+Plugin
http://wiki.hudson-ci.org/display/HUDSON/Gerrit+Trigger