aras-p / ClangBuildAnalyzer

Clang build analysis tool using -ftime-trace
The Unlicense
995 stars 64 forks source link

CMake does not work on macOS due to rt requirement #69

Closed nlohmann closed 3 years ago

nlohmann commented 3 years ago

The rt library is unconditionally added as requirement in file CMakeLists.txt:

target_link_libraries(ClangBuildAnalyzer -lrt -lpthread)

This library is not present on macOS, and hence the build fails.

When I remove the -lrt entry, building succeeds.

The line above should be changed like:

if (APPLE)
  target_link_libraries(ClangBuildAnalyzer -lpthread)
else()
  target_link_libraries(ClangBuildAnalyzer -lrt -lpthread)
endif()

I can make a PR if requested.

mathbunnyru commented 3 years ago

There's already that fixes this problem: https://github.com/aras-p/ClangBuildAnalyzer/pull/62

@aras-p may I kindly ask you to take a look, please?

nlohmann commented 3 years ago

Yes, #62 would fix this.

aras-p commented 3 years ago

Ok, blindly merged #62 (GitHub Actions are seemingly failing everywhere with internal errors today). 🤞