doyubkim / fluid-engine-dev

Fluid simulation engine for computer graphics applications
https://fluidenginedevelopment.org/
MIT License
1.9k stars 266 forks source link

Is gtest necessary in the CMakeLists.txt for the unit tests? #296

Closed cesss closed 4 years ago

cesss commented 4 years ago

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?

doyubkim commented 4 years ago

Good point. I also noticed a similar issue from other projects. Will post a PR soon!

cesss commented 4 years ago

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).

doyubkim commented 4 years ago

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.