288 Commits

Author SHA1 Message Date
Timothy Flynn
3f73528cad Meta: Move linter helpers to a subdirectory
Continuing some organization of the Meta directory. lint-ci.sh and
lint-commits.sh are left alone as "top-level" linters.
2026-04-23 07:31:19 -04:00
Andrew Kaster
c16d5ebe0e CMake: Set VCPKG_MANIFEST_FEATURES as a cache variable
This reduces vcpkg churn when it thinks that the manifest features have
changed, but they haven't due to the Gui framework staying the same.
2026-04-20 18:41:42 -04:00
Undefine
61c6b9230a Meta: Add the check-style target unconditionally
Python3 is guaranteed to be available as we require it to run some
generators.
2026-04-20 16:41:29 -06:00
Undefine
e39a8719fd Meta: Move most dependency checks to check_for_dependencies.cmake
This file was here for quite a long while now. Let's finally move most
of the dependency checks to one centralized place.
2026-04-20 16:41:29 -06:00
Undefine
2536690aa6 Meta: Remove a global link to Threads::Threads
Globally linking to anything isn't a good thing to do and this doesn't
seem to be necessary. If it ends up breaking any platform it can be
readded as a specific link later.
2026-04-20 16:41:29 -06:00
Undefine
26a62dd8d2 Meta: Remove ladybird_option
This was just a wrapper around set, which doesn't serve much purpose
since the SerenityOS days.
2026-04-20 16:41:29 -06:00
Johan Dahlin
1bf03c21d1 CMake: Add GTK4 as a GUI framework option
Add GTK as a possible GUI framework alongside Qt on Linux. When the gtk
or qt vcpkg manifest feature is selected, the corresponding framework
dependencies are pulled in automatically.
2026-04-17 11:17:56 -04:00
Andreas Kling
b23aa38546 AK: Adopt mimalloc v2 as main allocator
Use mimalloc for Ladybird-owned allocations without overriding malloc().
Route kmalloc(), kcalloc(), krealloc(), and kfree() through mimalloc,
and put the embedded Rust crates on the same allocator via a shared
shim in AK/kmalloc.cpp.

This also lets us drop kfree_sized(), since it no longer used its size
argument. StringData, Utf16StringData, JS object storage, Rust error
strings, and the CoreAudio playback helpers can all free their AK-backed
storage with plain kfree().

Sanitizer builds still use the system allocator. LeakSanitizer does not
reliably trace references stored in mimalloc-managed AK containers, so
static caches and other long-lived roots can look leaked. Pass the old
size into the Rust realloc shim so aligned fallback reallocations can
move posix_memalign-backed blocks safely.

Static builds still need a little linker help. macOS app binaries need
the Rust allocator entry points forced in from liblagom-ak.a, while
static ELF links can pull in identical allocator shim definitions from
multiple Rust staticlibs. Keep the Apple -u flags and allow those
duplicate shim symbols for LibJS and LibRegex links on Linux and BSD.
2026-04-08 09:57:53 +02:00
Undefine
9292c7bca9 AK: Move generating the Debug.h header to AK's CMakeLists 2026-03-29 13:59:11 -06:00
Undefine
731f1678ba Meta: Move install rules to its own helper cmake file
This feels like a thing that belongs somewhere else than the top level
CMakeLists file.
2026-03-29 13:59:11 -06:00
Undefine
a977e04efb Meta: Move compile_ipc calls to the relevant client library CMakeLists 2026-03-29 13:59:11 -06:00
Undefine
b5b69a3ba6 Meta: Move library subdirectory inclusion to the Libraries CMakeLists
It makes more sense to put all the specific libraries there instead
of putting some there and some in the top level CMakeLists.
2026-03-29 13:59:11 -06:00
Undefine
829d112327 Meta: Move Lagom CMakeLists stuff to the top level CMakeLists
This allows us to get rid of the annoying Build/.../Lagom directory
and helps to deduplicate a bunch of logic while also drastically
simplifying everything.
2026-03-29 13:59:11 -06:00
Undefine
539f4d0c9b Meta: Move all CMake options to a one unified file
Just another step of removing the split between lagom and common.
2026-03-29 13:59:11 -06:00
Undefine
ceca4a701b Meta: Move all compile options to one file
This is the first step to unify the common / lagom code paths which are
not relevant since the SerenityOS fork.
2026-03-29 13:59:11 -06:00
Undefine
fbbcc73fea Meta: Refactor the way the GUI framework is picked
This is largely based of off the work done by Andrew Kaster in #5918.
Having this toggle makes much more sense, especially if there will be
more UIs in the future.

Co-authored-by: Andrew Kaster <andrew@ladybird.org>
2026-03-29 13:59:11 -06:00
Undefine
4eda70a4f1 Meta: Move the Qt6 dependency stuff to the Qt UI CMake
Instead of this awkward place let's move it to the Qt UI CMakeLists,
which makes much more sense for stuff like this.
2026-03-29 13:59:11 -06:00
Andreas Kling
e87f889e31 Everywhere: Abandon Swift adoption
After making no progress on this for a very long time, let's acknowledge
it's not going anywhere and remove it from the codebase.
2026-02-17 10:48:09 -05:00
ayeteadoe
ee3c033de2 LibWebView: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
91e7664849 CMake: Allow Windows to build Lib/Test GUI targets 2025-06-26 19:35:14 -06:00
Andrew Kaster
30fe721a3d CMake: Set a higher default CMAKE_OSX_DEPLOYMENT_TARGET with Swift
We have tests that require 15.0 without checking for availability.
2025-05-30 12:54:12 -04:00
Andrew Kaster
68bba89dc3 CMake: Set macOS deployment target for vcpkg ports to match our build
Without this, ports get built with whatever default is there from the
toolchain, and we get all sorts of linker warnings about a mismatch.
2025-05-30 12:54:12 -04:00
ayeteadoe
0061c64ee6 CMake: Remove duplicate sanitizer configuration
Root had identical copy of what was being done in Meta/Lagom
so now we ensure this is still included globally but is
isolated to its own cmake module to make sanitizer
config easier to discover
2025-05-14 02:05:12 -06:00
Andrew Kaster
e1369aa7d6 CMake: Explicitly set CMAKE_OSX_SYSROOT to macosx for macOS host builds
The implicit default CMAKE_OSX_SYSROOT was a workaround in CMake for
macOS ~10.8. As of CMake 4.x, CMake expects macOS host compilers to have
their own default sysroot detection logic. However, upstream llvm does
not actually do this, only Apple Clang does. To keep supporting homebrew
clang and manually compiled clang from llvm/llvm-project, we need to
set the sysroot explicitly.

The behavior difference and lack of default detection logic in the clang
driver is tracked at https://gitlab.kitware.com/cmake/cmake/-/issues/26863
2025-04-22 17:31:12 -04:00
Timothy Flynn
60dd5cc4ef UI/Qt: Migrate to LibWebView's autocomplete engine
As a result, we now no longer depend on Qt::Network.
2025-04-02 08:52:45 -04:00
devgianlu
62cd358fab Meta: Link with OpenSSL explicitly
Explicitly link final targets with OpenSSL to ensure that the vcpkg
version is loaded instead of the system one.

Before this change we would inherit `libcrypto.so` and `libssl.so` from
other dependencies, like Qt, that do not have their RPATH rewritten.
This would cause the loader to prefer the system libraries over the
vcpkg ones causing all sorts of version mismatch issues.

The effectiveness of this change can be verified with
`readelf -d ./bin/Ladybird` showing `libcrypto.so` and `libssl.so` as
direct dependencies, before they would not appear. Additionally, `ldd`
will show `libcrypto.so` and `libssl.so` pointing to the vcpkg builds.
2025-02-17 12:36:26 +01:00
Andrew Kaster
c1596192fa CMake: Add workaround for binutils+patchelf incompatability 2024-12-12 17:22:34 -07:00
Timothy Flynn
9e1f001ffe LibWebView+Services+UI: Move the EventLoop implementations to LibWebView
We currently compile the Qt event loop files multiple times, for every
target which wants to use them. This patch moves these to LibWebView as
a central location to avoid this.
2024-11-11 07:35:43 -05:00
Timothy Flynn
db47cc41f8 Everywhere: Move the Ladybird folder to UI 2024-11-10 12:50:45 +01:00
Timothy Flynn
22e0eeada2 Everywhere: Hoist the Services folder to the top-level 2024-11-10 12:50:45 +01:00
Timothy Flynn
19fb790dc6 WebDriver: Move all WebDriver configuration to Services 2024-11-09 17:54:21 +01:00
Andrew Kaster
cc02e7a763 CMake: Update homepage url in project() declaration to point to .org 2024-09-23 16:40:08 -06:00
Andrew Kaster
7afe183172 CMake: Add proper sanitizer options for Swift files
Apparently UBSAN + Swift doesn't work on Linux :<
2024-07-30 18:38:02 -06:00
Andrew Kaster
45301e8169 Everywhere: Remove AK_DONT_REPLACE_STD macro
Let's just always include `<utility>`. Placing our own incompatible with
the STL declaration of these functions in AK was always fishy to begin
with.
2024-07-30 18:38:02 -06:00
Andrew Kaster
922c6bde87 CMake: Enable policy 0157 for more control over Swift compile mode 2024-07-21 15:55:47 -06:00
Andrew Kaster
68ce5f8290 Ladybird/AppKit: Port TaskManager window to Swift
This is just a direct port of the Objective-C++ code to Swift 6.
A future patch should probably update it to actually use SwiftUI.
2024-07-21 15:55:47 -06:00
Andrew Kaster
4066ce2c7e CMake: Ensure C/C++ compile options only applied when compiling C/C++ 2024-07-21 15:55:47 -06:00
Andrew Kaster
8e5d28de3c CMake: Force vcpkg to use CMAKE_CXX_COMPILER as specified to CMake
Override the vcpkg/scripts/detect_compiler behavior of always pulling
$CC and $CXX at the time that vcpkg install is determined to need called
by forcing $ENV{CXX} and $ENV{CC} to our CMake-determined compiler.

This prevents strange behavior such as running the following:

./Meta/ladybird.sh run
    make changes...
ninja -C Build/ladybird

Where the second build step would be run without CC or CXX set in the
environment, causing a total cache miss from vcpkg and a full rebuild.

It also helps prevent full rebuilds when an IDE passes a slightly
different compiler to the build step than ladybird.sh.
2024-07-18 14:48:20 +02:00
luozhiya
9ced3ec84d Meta: CMakeLists invoke check_style.py 2024-07-08 18:03:42 -06:00
Andrew Kaster
62268cca9e CMake: Add ENABLE_GUI_TARGETS option to enable disabling GUI components
This is useful when, e.g. building the test262 runner on its own.
2024-07-07 09:51:29 -06:00
Alex Studer
1d0de0b450 Android: Integrate vcpkg with Gradle build
This ensures that vcpkg downloads and builds all dependencies for
Android. We add it as a CMAKE_TOOLCHAIN_FILE that then chainloads the
Android NDK's toolchain file, as per the vcpkg documentation.
2024-07-05 14:27:25 -06:00
Andrew Kaster
1e3e36af11 Meta+CMake: Move vcpkg directives to ladybird.sh and CMakePresets
Also add a vcpkg command to ladybird.sh to ensure that vcpkg is setup,
and use a local binary cache for vcpkg build and install media to
avoid cluttering $XDG_CACHE_HOME.
2024-06-07 11:15:48 -04:00
Timothy Flynn
65ddd0553b Meta+LibWebView: Install and link sqlite3 with vcpkg
We will use sqlite3 as a replacement for LibSQL. Using a tried-and-true
database will allow us to avoid maintaining our an incomplete, non-ACID,
and less performant implementation. It also means we do not have to
launch and manage the singleton SQLServer process.
2024-06-06 11:27:03 -04:00
Andrew Kaster
90af26e309 Meta+CMake: Remove unused CMake functions and features
Goodbye, serenity_components and Jakt.
2024-06-05 12:23:54 -04:00
Andrew Kaster
66d91fa08c Meta: Add new top-level CMakeLists 2024-06-04 13:44:22 -06:00
Andrew Kaster
472df45b38 CMake: Remove Serenity's CMakeLists.txt 2024-06-03 11:42:56 -06:00
Tim Ledbetter
1a4fbfe495 Everywhere: Remove references to the kernel 2024-06-03 10:53:53 +02:00
Andrew Kaster
6c5e09557d CMake: Enable ClangPlugins for Serenity builds if ENABLE_CLANG_PLUGINS 2024-05-14 12:46:05 -06:00
Matthew Olsson
4ae7bbda52 Lagom: Add ClangPlugins to the build system 2024-05-13 16:50:54 -06:00
Dan Klishch
fa1eef8bbe Toolchain: Update LLVM to 18.1.3
Apart from bumping the toolchain Clang's and port's version, this commit
completely overhauls the way LLVM toolchain is built.

First, it gets rid of a complicated two-stage process of first compiling
clang and compiler-rt builtins and then building libunwind, libc++abi,
and libc++ -- it is possible to create a complete cross-compilation
toolchain in a single CMake invocation with a modern LLVM. Moreover, the
old method was inherently unsupported and subtly broken.

Next, it utilizes full potential of the Stubs "framework". Now we are
even able to compile Clang with -Wl,-z,defs which makes one of the
patches obsolete and the whole installation less error-prone. Note that
it comes at a cost of complicating the bootstrap process on a completely
novel architecture but this hopefully won't happen often.

Lastly, it fixes handling of the -no*lib* family of flags in the
Serenity LLVM driver and correctly uses -nostartfiles in conjunction
with stubs to make necessary CMake configure-time checks succeed.
2024-04-18 13:14:33 -06:00