Build prerequisites
Qt6 development packages, nasm, additional build tools, and a C++23 capable compiler are required. A Rust toolchain is also required for building the JavaScript engine. You can install it via rustup or your system’s package manager.We currently use gcc-14 and clang-21 in our CI pipeline. If these versions are not available on your system, see
Meta/find_compiler.py for the minimum compatible version.Platform-specific dependencies
- Debian/Ubuntu
- Arch Linux/Manjaro
- Fedora
- openSUSE
- Void Linux
- macOS
- Windows
- Android
- FreeBSD
- NixOS
1
Install base dependencies
2
Install CMake 3.30 or newer
This repository is Ubuntu-only
3
Install a C++23-capable compiler
- Clang (Recommended)
- GCC (Alternative)
Install clang from LLVM’s apt repository:
4
Install audio support (optional)
Build steps
Using ladybird.py
The simplest way to build and run ladybird is via theladybird.py script:
- Standard build
- macOS with homebrew clang
- Debug build
- With gdb
The user interfaces
Ladybird will be built with one of the following browser frontends, depending on the platform:- AppKit - The native UI on macOS
- Qt - The UI used on all other platforms
- Android UI - The native UI on Android
-DENABLE_QT=OFF.
Custom CMake build directory
The scriptMeta/ladybird.py and the default preset in CMakePresets.json both define a build directory of Build/release. For distribution purposes, or when building multiple configurations, it may be useful to create a custom CMake build directory.
The install rules in
UI/cmake/InstallRules.cmake define which binaries and libraries will be installed into the configured CMAKE_PREFIX_PATH or path passed to cmake --install.Building with limited system memory
The default build mode will run as many build steps in parallel as possible, which includes link steps; this may be an issue for users with limited system memory. If you wish to reduce the number of parallel link jobs, you may use theLAGOM_LINK_POOL_SIZE cmake option:
Running manually
TheMeta/ladybird.py script will execute the run-ladybird and debug-ladybird custom targets. If you don’t want to use the script, you can run the following commands:
Resource files
Ladybird requires resource files from theladybird/Base/res directory in order to properly load icons, fonts, and other theming information. These files are copied into the build directory by special CMake rules.
The expected location of resource files can be tweaked by packagers using the standard
CMAKE_INSTALL_DATADIR variable. CMAKE_INSTALL_DATADIR is expected to be a path relative to CMAKE_INSTALL_PREFIX. If it is not, things will break.Debugging
Debugging with CLion
Ladybird should be built with debug symbols first. This can be done by adding-DCMAKE_BUILD_TYPE=Debug to the cmake command line, or selecting the Build Type Debug in the CLion CMake profile.
After running Ladybird with ./Meta/ladybird.py run ladybird, you can use Run → Attach to Process in CLion to connect. If debugging layout or rendering issues, filter the listing for WebContent and attach to that.
Now breakpoints, stepping and variable inspection will work.
Debugging with Xcode or Instruments on macOS
If all you want to do is use Instruments, then an Xcode project is not required. Simply run theladybird.py script as normal, and then make sure to codesign the Ladybird binary with the proper entitlements to allow Instruments to attach to it:
Common build errors
Unable to find a build program corresponding to “Ninja”
This error message is a red herring. We use vcpkg to manage our third-party dependencies, and this error is logged when something went wrong building those dependencies. The output in your terminal will vary depending on what exactly went wrong, but it should look something like:Experimental GN build
There is an experimental GN build for Ladybird. It is not officially supported, but it is kept up to date on a best-effort basis by interested contributors. See the GN build instructions inMeta/gn/README.md for more information.
In general, the GN build organizes ninja rules in a more compact way than the CMake build, and it may be faster on some systems. GN also allows building host and cross-targets in the same build directory, which is useful for managing dependencies on host tools when cross-compiling to other platforms.