Check for compiler flag support instead of checking for a platform

As part of #2108 we added ```-Wno-unused-const-variable``` if we detect the clang compiler on OS X. Looks like this was only introduced in version ```3.4```.