Closed cesss closed 4 years ago
Good point. I also noticed a similar issue from other projects. Will post a PR soon!
Actually, I'm not sure of how gtest/gmock should be linked. I never used them before, and, honestly, I don't like how their code looks (it looks like a pretty untidy design, at least at first glance).
There are other alternatives like Catch which is also quite popular. I chose gtest since love it or not it's widely used and supported by a variety of IDEs (such as VSCode via extension, CLion, etc). But it is true that it's been one of the major sources of breaking the builds whenever a new version of a compiler is introduced.
The CMakeLists.txt for the unit tests specifies to link both with gmock and with gtest. When building them static, I got a duplicate symbol in some OSs.
But then I realize that if you link with gmock only, it works fine. So, is the gtest library really needed?