Fix google mocking framework detection

Google unit testing and mocking framework has to be compiled
with the same compiler flags as the code you are testing.