diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -13,21 +13,33 @@ The console lets you type C or C++ directly into the debugger, which LLDB JIT-co  ## Build -hsdbg builds on macOS, Linux, and Windows. You'll need [premake5](https://premake.github.io/) and a C++23 compiler. hsdbg links against LLVM/LLDB. By default, it pulls the pinned LLVM release (22.1.0) for your platform. Alternatively, you can point it at an existing LLVM installation that ships the LLDB headers with `LLVM_PREFIX`, or have `llvm-config` available on your `PATH`. +hsdbg builds on macOS, Linux, and Windows. You'll need [meson](https://mesonbuild.com/), [ninja](https://ninja-build.org/), Python 3, and a C++23 compiler. hsdbg links against LLVM/LLDB. Running `tools/fetch_llvm.py` pulls the pinned LLVM release (22.1.0) for your platform. Alternatively, you can point it at an existing LLVM installation that ships the LLDB headers with `-Dllvm_prefix=<path>` or the `LLVM_PREFIX` environment variable, or have `llvm-config` available on your `PATH`. ```bash -$ git clone --recursive https://git.hachem.wtf/hachem/hsdbg.git +$ git clone --recursive https://git.hachem.wtf/hsdbg.git $ cd hsdbg -$ premake5 fetch-llvm -$ premake5 gmake2 -$ make config=dist +$ python3 tools/fetch_llvm.py +$ meson setup build --buildtype=release -Db_ndebug=true +$ ninja -C build -$ ./bin/dist-macosx/hsdbg ./a.out +$ ./build/hsdbg ./a.out ``` -The binary lands in `bin/dist-<system>/hsdbg`. +The binary lands in `build/hsdbg`. +Each meson build directory is one configuration; set up whichever you need: + +```bash +# debug: symbols, asserts, address + UB sanitizers +$ meson setup build-debug --buildtype=debug -Db_sanitize=address,undefined +# release: optimized, asserts still on +$ meson setup build-release --buildtype=release +# dist: optimized, asserts off (defines HSDBG_DIST), stripped +$ meson setup build-dist --buildtype=release -Db_ndebug=true --strip +``` + +Build any of them with `ninja -C <dir>`. Two helper targets are also available: `ninja -C <dir> fetch-llvm` re-downloads the pinned LLVM, and `ninja -C <dir> cppcheck` runs static analysis against the generated `compile_commands.json` (analyze a `dist` build dir so cppcheck sees the code without the debug-only asserts and sanitizers). ## License hsdbg is released under the [MIT License](LICENSE). |
