google / bloaty

Bloaty: a size profiler for binaries
Apache License 2.0
4.79k stars 346 forks source link

building on macOS is tricky due to capstone.h inclusion #342

Open slimsag opened 1 year ago

slimsag commented 1 year ago

Almost the same issue as https://github.com/raspberrypi/openocd/issues/30 - on macOS bloaty's cmake file fails to find capstone.h due to the fact that Homebrew stores capstone headers in a different location than bloaty's cmake file expects (see the linked issue for details)

I am just creating this issue to mention it is a problem; and also to let other macOS users know the workaround:

export CXXFLAGS=-isystem\ /opt/homebrew/Cellar/capstone/4.0.2/include 
cmake -B build -G Ninja -S .
cmake --build build
max0x53 commented 1 year ago

I believe the following cmake option will also resolve your issue on MacOS.

cmake -B build -DBLOATY_PREFER_SYSTEM_CAPSTONE=NO -G Ninja -S .
cmake --build build