A cross-platform application demonstrating Crashpad integration with CMake.
This project demonstrates how to:
- Set up a CMake project for cross-platform development
- Integrate Google's Crashpad library for crash reporting
- Create a simple crashing application that generates crash reports
- CMake (version 3.10 or higher)
- A C++ compiler (gcc, clang, MSVC, etc.)
- Install depot_tools - Google's tools for working with Chromium source code
- A BugSplat account and database (sign up at bugsplat.com)
- Sign up for a BugSplat account at bugsplat.com if you haven't already
- Create a new database in your BugSplat dashboard
- Open
main.h
and define your database name:#define BUGSPLAT_DATABASE "your-database-name" // Replace with your database name from BugSplat
- Clone the depot_tools repository:
# For Linux/macOS
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- Add depot_tools to your PATH:
# For Linux/macOS - add to your .bashrc or .zshrc
export PATH="$PATH:/path/to/depot_tools"
# For Windows - add to system environment variables or use:
$env:Path = "C:\path\to\depot_tools;$env:Path"
- For Windows, you also need to run:
# From the depot_tools directory
gclient
Symbol uploads must be configured so that crash reports contain function names, file names, and line numbers. The symbol upload process uses BugSplat's symbol-upload utility, which is automatically downloaded as needed.
On Windows, symbol-upload-windows.exe will search for .pdb
files, on macOS symbol-upload-macos will search for .dSYM
files, and on Linux, symbol-upload-linux will search for .debug
files. All files are automatically converted to Crashpad/Breakpad compatible .sym
files before uploading.
To configure symbol upload, ensure you have:
- Defined your BugSplat database name in
main.h
as described in the BugSplat Setup section - Set up your BugSplat API credentials (
BUGSPLAT_CLIENT_ID
andBUGSPLAT_CLIENT_SECRET
) in the.env
file. You can generate a Client ID/Client Secret pair on the Integrations page.
The build scripts will automatically fetch and build Crashpad using depot_tools
, then build the main application using CMake.
# Execute the build script
./scripts/build_macos.sh
# Run the application
./build/MyCMakeCrasher
# Execute the build script
./scripts/build_linux.sh
# Run the application
./build/MyCMakeCrasher
# Execute the build script
.\scripts\build_windows_msvc.ps1
# Run the application
.\build\Debug\MyCMakeCrasher.exe
The application will crash immediately upon launch to demonstrate the crash reporting functionality. Crashes will be automatically uploaded to BugSplat. To view crashes, navigate to the Dashboard page and ensure the correct database is selected.

Click the value in the ID
column to see the report's stack trace and associated metadata.

Thanks for using BugSplat!