bustub icon indicating copy to clipboard operation
bustub copied to clipboard

(fix) Fixing build issue for googletest on Mac

Open varunu28 opened this issue 2 months ago • 2 comments

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 image

Also invoked test & it failed(as expected) which verifies that the test library is working as intended Screenshot 2025-10-30 at 9 55 07 AM

Screenshot 2025-10-31 at 5 37 53 AM

varunu28 avatar Oct 30 '25 17:10 varunu28

@apavlo I have updated the check to be applied only when googletest dependency is present in the system.

varunu28 avatar Oct 31 '25 12:10 varunu28

@apavlo Can you please re-trigger the build workflow to verify the latest commit? Thanks :)

varunu28 avatar Nov 05 '25 13:11 varunu28