aras-p / ClangBuildAnalyzer

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

Build failure with CMake because of #define min/max in Windows.h #72

Closed xndc closed 2 years ago

xndc commented 3 years ago

ClangBuildAnalyzer pulls in Windows.h at several points, leading to these compilation errors:

src\main.cpp(175): error C2589: '(': illegal token on right side of '::'
src\external\flat_hash_map\flat_hash_map.hpp(1282): error C2589: '(': illegal token on right side of '::'

It looks like you've avoided this in the Visual Studio project by adding a global NOMINMAX define.

This should be done for the CMake build as well. I fixed it locally by adding this to CMakeLists:

target_compile_definitions(ClangBuildAnalyzer PRIVATE "NOMINMAX")
aras-p commented 2 years ago

Should be fixed by #80 (merged into main branch, I'll tag the 1.2.0 release binaries soon)