1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 00:30:47 +00:00
serenity/Meta/gn
Andrew Kaster 9a3e9047a5 Meta: Update GN build for recent changes
9a026fc8d5
ae1ac9871b
07b332e17c

And some missed changes from the past that weren't hit because no one
was referencing those symbols :^).
2023-10-11 10:56:24 -06:00
..
build Meta: Make embed_as_string_view.py usable by CMake builds :^) 2023-08-24 07:42:12 +01:00
secondary Meta: Update GN build for recent changes 2023-10-11 10:56:24 -06:00
.gitignore
README.md Meta: Add example linux gn args, fix CSS build on case-insensitive FS 2023-07-09 16:29:31 -06:00

gn build for SerenityOS and Ladybird

Warning! The GN build is experimental and best-effort. It might not work, and if you use it you're expected to feel comfortable to unbreak it if necessary. Serenity's official build system is CMake, if in doubt use that. If you add files, you're expected to update the CMake build but you don't need to update GN build files. Reviewers should not ask authors to update GN build files. Keeping the GN build files up-to-date is on the people who use the GN build.

GN is a metabuild system. It always creates ninja files, but it can create some IDE projects (MSVC, Xcode, ...) which then shell out to ninja for the actual build.

This is a good overview of GN.

For more information, motivation, philosophy, and inspriation, see the LLVM documentation on its GN build

Typical gn args

On macOS, the default args should work out of the box. For compiling Ladybird there won't be any tailoring needed if you have Qt6 installed via homebrew and the Xcode tools installed.

On Ubuntu, it's likely that the default cc and cxx will not be able to compile the project. For compiling Ladybird, a typical args.gn might look like the below:

args.gn

# Set build arguments here. See `gn help buildargs`.
# Chosen clang must be >= version 15.0.0
host_cc="clang"
host_cxx="clang++"
is_clang=true
use_lld=true
qt_install_headers="/usr/include/x86_64-linux-gnu/qt6/"
qt_install_lib="/usr/lib/x86_64-linux-gnu"
qt_install_libexec="/usr/lib/qt6/libexec/"

As with any gn project, gn args <build dir> --list is your best friend.