google / binexport

Export disassemblies into Protocol Buffers
Apache License 2.0
1.05k stars 206 forks source link

Fix the binary ninja plugin build after the introduction of fmt library into the binary ninja API #121

Closed xusheng6 closed 10 months ago

xusheng6 commented 10 months ago

A while ago, we (vector35) added fmt as a dependency in the binaryninja-api and that is breaking the binexport build. I made two fixes to it so the build can work. The two fixes are:

  1. when cloning the binaryninja-api repo, recursively clone all submodules. This will include the fmt library which is necessary for it to build. The reason that I did not specify this fmt library explicity in the CMake is that will break the build for people trying to build against an earlier version of BN, e.g., the stable 3.5, which is before we introduced the fmt into the binaryninja-api. The tradeoff is several unnecessary submodules will also be cloned, but I think that is a reasonable tradeoff.
  2. I include binaryninjacore.h instead of the binaryninjaapi.h in the binaryninjacore.cc. binaryninjaapi.h references fmt as well as many other irrelevant things for the purpose of building a substitute binaryninjacore, so I included the binaryninjacore.h which has less distractions.

I am testing against the Jordan's binexport build script: https://gist.github.com/psifertex/31d9bc3167eca91e466ebaae4382521c, though I believe it should also fix the build for other script or workflow.

xusheng6 commented 10 months ago

The build appears to have failed because PRs do not have access to the secrets

xusheng6 commented 10 months ago

Closing this for now to stop it from spamming the actions history