(fix) Fixing build issue for googletest on Mac
Heads Up
Please note that this PR was created by someone who has almost no knowledge of C++ build system. So if you think something doesn't makes sense then there is a pretty good chance that you are right. I have almost no clue of the CMake build system & I am happy to learn the ropes here. Also for full transparency, I have leveraged LLM tools to understand the underlying root cause & triage this issue.
Why this change?
This change tries to address #834 .
Actual code change
The issue was happening as system headers were given a priority over the bundled third party dependencies due to usage of SYSTEM keyword. The fix removes the SYSTEM keyword from CMakeLists.txt from both googletest dependencies & also adds bundled googletest include directories with BEFORE keyword in order for CMake to include these paths in the beginning of dependency scan.
Testing
make finishes successfully
Also invoked test & it failed(as expected) which verifies that the test library is working as intended
@apavlo I have updated the check to be applied only when googletest dependency is present in the system.
@apavlo Can you please re-trigger the build workflow to verify the latest commit? Thanks :)