google/benchmark — pull request #44 by mattyclarkson (2014-08-01 10:00:14+00:00)
Title: Compiler Flags

The compiler flags are currently set assuming `gcc` or `clang`. We should detect if compiler flags are supported so that when compilers are added in the future (looking at you `cl.exe`) we can add specific compiler flags for those compilers as well.

CMake has a default set of compiler flags for each compiler it detects, we should play nicely with this so that we leverage the good work done by CMake. This branch appends flags to the detected flags.

**Net result**:
- The compiler flags for `gcc` and `clang` are the same as before the patches but leverage the built in flags and also detect that the flags are actually available
- I've added detection for `-Wshadow` and added that as it's a good warning to look for. However, I would happily drop this if anyone has any objections. The code currently cleanly passes this warning on `gcc-4.9`. I know that `-Wshadow has had a sketchy history with false positives on older versions of `gcc`.

In the future we are going to need MSVC flags that force that compiler into the closest to standards mode it goes. Again using flag detection is the way to go.