Meta: Change the default build directories to exclude "ladybird" prefix

The reason for this change is that CMake/vcpkg are unable to detect a
change to VCPKG_LIBRARY_LINKAGE. So when we switch to dynamic builds,
the switch would be non-functional, and every developer would have to
remove their Build and vcpkg cache directories manually. By changing
these directories, vcpkg is able to detect it must rebuild.
This commit is contained in:
Timothy Flynn 2024-09-30 09:55:48 -04:00 committed by Andrew Kaster
parent dfd928a8f8
commit 4ffca2089e
Notes: github-actions[bot] 2024-11-06 17:40:19 +00:00
9 changed files with 48 additions and 48 deletions

View file

@ -1,5 +1,5 @@
CompileFlags:
CompilationDatabase: Build/ladybird
CompilationDatabase: Build/release
Diagnostics:
UnusedIncludes: None

View file

@ -10,7 +10,7 @@
"hidden": true,
"name": "default_base",
"displayName": "Default Config",
"binaryDir": "${fileDir}/Build/ladybird",
"binaryDir": "${fileDir}/Build/release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"SERENITY_CACHE_DIR": "${fileDir}/Build/caches",
@ -92,7 +92,7 @@
"inherits": "default",
"displayName": "Debug Config",
"description": "Debug build using Ninja generator",
"binaryDir": "${fileDir}/Build/ladybird-debug",
"binaryDir": "${fileDir}/Build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"VCPKG_OVERLAY_TRIPLETS": "${fileDir}/Meta/CMake/vcpkg/debug-triplets"
@ -103,7 +103,7 @@
"inherits": "default",
"displayName": "Sanitizer Config",
"description": "Sanitizer build using Ninja generator",
"binaryDir": "${fileDir}/Build/ladybird-sanitizers",
"binaryDir": "${fileDir}/Build/sanitizers",
"cacheVariables": {
"ENABLE_UNDEFINED_SANITIZER": "ON",
"ENABLE_ADDRESS_SANITIZER": "ON",
@ -145,7 +145,7 @@
],
"displayName": "Fuzzers Config",
"description": "Fuzzers build with GitHub Actions cache",
"binaryDir": "${fileDir}/Build/ladybird-fuzzers",
"binaryDir": "${fileDir}/Build/fuzzers",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "",
"ENABLE_QT": "OFF",

View file

@ -6,7 +6,7 @@ This file covers a few advanced scenarios that go beyond what the basic build gu
The `Meta/ladybird.sh` script provides an abstraction over the build targets which are made available by CMake. The
following build targets cannot be accessed through the script and have to be used directly by changing the current
directory to `Build/ladybird` and then running `ninja <target>`:
directory to `Build/release` and then running `ninja <target>`:
- `ninja check-style`: Runs the same linters the CI does to verify project style on changed files
- `ninja lint-shell-scripts`: Checks style of shell scripts in the source tree with shellcheck

View file

@ -254,17 +254,17 @@ Elapsed time to handle skia:x64-linux: 1.6 s
-- Running vcpkg install - failed
CMake Error at Toolchain/Tarballs/vcpkg/scripts/buildsystems/vcpkg.cmake:899 (message):
vcpkg install failed. See logs for more information:
Build/ladybird/vcpkg-manifest-install.log
Build/release/vcpkg-manifest-install.log
Call Stack (most recent call first):
/usr/share/cmake-3.30/Modules/CMakeDetermineSystem.cmake:146 (include)
CMakeLists.txt:15 (project)
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred! See logs for more information:
Build/ladybird/vcpkg-manifest-install.log
Build/release/vcpkg-manifest-install.log
```
If the error is not immediately clear from the terminal output, be sure to check `Build/ladybird/vcpkg-manifest-install.log`
If the error is not immediately clear from the terminal output, be sure to check the specified `vcpkg-manifest-install.log`.
for more information.
### Resource files
@ -278,7 +278,7 @@ to CMAKE_INSTALL_PREFIX. If it is not, things will break.
### Custom CMake build directory
The script Meta/ladybird.sh and the default preset in CMakePresets.json both define a build directory of
`Build/ladybird`. For distribution purposes, or when building multiple configurations, it may be useful to create a custom
`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 Ladybird/cmake/InstallRules.cmake define which binaries and libraries will be
@ -302,20 +302,20 @@ If you don't want to use the ladybird.sh script to run the application, you can
To automatically run in gdb:
```
ninja -C Build/ladybird debug-ladybird
ninja -C Build/release debug-ladybird
```
To run without ninja rule on non-macOS systems:
```
./Build/ladybird/bin/Ladybird
./Build/release/bin/Ladybird
```
To run without ninja rule on macOS:
```
open -W --stdout $(tty) --stderr $(tty) ./Build/ladybird/bin/Ladybird.app
open -W --stdout $(tty) --stderr $(tty) ./Build/release/bin/Ladybird.app
# Or to launch with arguments:
open -W --stdout $(tty) --stderr $(tty) ./Build/ladybird/bin/Ladybird.app --args https://ladybird.dev
open -W --stdout $(tty) --stderr $(tty) ./Build/release/bin/Ladybird.app --args https://ladybird.dev
```
### Experimental GN build
@ -344,9 +344,9 @@ Simply run the `ladybird.sh` script as normal, and then make sure to codesign th
```
./Meta/ladybird.sh build
ninja -C build/ladybird apply-debug-entitlements
ninja -C Build/release apply-debug-entitlements
# or
codesign -s - -v -f --entitlements Meta/debug.plist Build/ladybird/bin/Ladybird.app
codesign -s - -v -f --entitlements Meta/debug.plist Build/release/bin/Ladybird.app
```
Now you can open the Instruments app and point it to the Ladybird app bundle.
@ -355,7 +355,7 @@ If you want to use Xcode itself for debugging, you will need to generate an Xcod
The `ladybird.sh` build script does not know how to generate Xcode projects, so creating the project must be done manually.
```
cmake -GXcode -B Build/ladybird
cmake -GXcode -B Build/release
```
After generating an Xcode project into the specified build directory, you can open `ladybird.xcodeproj` in Xcode. The project has a ton of targets, many of which are generated code.
@ -373,7 +373,7 @@ When running Ladybird, make sure that XDG_RUNTIME_DIR is set, or it will immedia
doesn't find a writable directory for its sockets.
```
CMAKE_PREFIX_PATH=/usr/lib/qt/6.2/lib/amd64/cmake cmake -GNinja -B Build/ladybird -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
cmake --build Build/ladybird
XDG_RUNTIME_DIR=/var/tmp ninja -C Build/ladybird run
CMAKE_PREFIX_PATH=/usr/lib/qt/6.2/lib/amd64/cmake cmake -GNinja -B Build/release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
cmake --build Build/release
XDG_RUNTIME_DIR=/var/tmp ninja -C Build/release run
```

View file

@ -7,7 +7,7 @@ Emacs can be configured with `lsp-mode` and `clangd` to work well.
The official clangd extension can be used for C++ comprehension.
Run cmake (`Meta/ladybird.sh run ladybird` or similar) at least once for clangd
to work, as doing so will generate the `Build/ladybird/compile_commands.json`
to work, as doing so will generate the `Build/release/compile_commands.json`
that is needed by `clangd`.
### lsp-mode

View file

@ -25,10 +25,10 @@ First, make sure you have a working toolchain and can build and run Ladybird. Go
Userland/
Userland/Libraries/
Userland/Services/
Build/ladybird/
Build/ladybird/Userland/
Build/ladybird/Userland/Libraries/
Build/ladybird/Userland/Services/
Build/release/
Build/release/Userland/
Build/release/Userland/Libraries/
Build/release/Userland/Services/
AK/
```

View file

@ -28,7 +28,7 @@ Clangd has the best support for modern compilers, especially if configured as no
The official clangd extension can be used for C++ comprehension. It is recommended in general, as it is most likely to work on all platforms.
clangd uses ``compile_commands.json`` files to understand the project. CMake will generate these in Build/ladybird.
clangd uses ``compile_commands.json`` files to understand the project. CMake will generate these in Build/release.
Run ``./Meta/ladybird.sh run ladybird`` at least once to generate the ``compile_commands.json`` file.
@ -58,10 +58,10 @@ following ``c_cpp_properties.json`` to circumvent some errors. Even with the con
"name": "ladybird-gcc",
"includePath": [
"${workspaceFolder}",
"${workspaceFolder}/Build/ladybird/",
"${workspaceFolder}/Build/ladybird/Userland",
"${workspaceFolder}/Build/ladybird/Userland/Libraries",
"${workspaceFolder}/Build/ladybird/Userland/Services",
"${workspaceFolder}/Build/release/",
"${workspaceFolder}/Build/release/Userland",
"${workspaceFolder}/Build/release/Userland/Libraries",
"${workspaceFolder}/Build/release/Userland/Services",
"${workspaceFolder}/Userland",
"${workspaceFolder}/Userland/Libraries",
"${workspaceFolder}/Userland/Services"
@ -72,7 +72,7 @@ following ``c_cpp_properties.json`` to circumvent some errors. Even with the con
"cStandard": "c17",
"cppStandard": "c++23",
"intelliSenseMode": "linux-gcc-x86",
"compileCommands": "Build/ladybird/compile_commands.json",
"compileCommands": "Build/release/compile_commands.json",
"compilerArgs": [
"-Wall",
"-Wextra",
@ -81,16 +81,16 @@ following ``c_cpp_properties.json`` to circumvent some errors. Even with the con
"browse": {
"path": [
"${workspaceFolder}",
"${workspaceFolder}/Build/ladybird/",
"${workspaceFolder}/Build/ladybird/Userland",
"${workspaceFolder}/Build/ladybird/Userland/Libraries",
"${workspaceFolder}/Build/ladybird/Userland/Services",
"${workspaceFolder}/Build/release/",
"${workspaceFolder}/Build/release/Userland",
"${workspaceFolder}/Build/release/Userland/Libraries",
"${workspaceFolder}/Build/release/Userland/Services",
"${workspaceFolder}/Userland",
"${workspaceFolder}/Userland/Libraries",
"${workspaceFolder}/Userland/Services"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "${workspaceFolder}/Build/ladybird/"
"databaseFilename": "${workspaceFolder}/Build/release/"
}
}
],
@ -165,7 +165,7 @@ The following three example tasks should suffice in most situations, and allow y
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/ladybird"
"${workspaceFolder}/Build/release"
]
}
],
@ -199,14 +199,14 @@ The following three example tasks should suffice in most situations, and allow y
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/ladybird"
"${workspaceFolder}/Build/release"
]
},
{
"source": "gcc",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/ladybird"
"${workspaceFolder}/Build/release"
],
"pattern": [
{
@ -241,14 +241,14 @@ The following three example tasks should suffice in most situations, and allow y
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/ladybird"
"${workspaceFolder}/Build/release"
]
},
{
"source": "gcc",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/ladybird"
"${workspaceFolder}/Build/release"
],
"pattern": [
{
@ -275,7 +275,7 @@ The following three example tasks should suffice in most situations, and allow y
],
"fileLocation": [
"relative",
"${workspaceFolder}/Build/ladybird"
"${workspaceFolder}/Build/release"
]
}
]

View file

@ -91,7 +91,7 @@ Enabling the Qt chrome is recommended when running the Web Platform Tests on Mac
following command:
```sh
cmake -GNinja Build/ladybird -DENABLE_QT=ON
cmake -GNinja Build/release -DENABLE_QT=ON
```
Example usage:

View file

@ -67,13 +67,13 @@ get_build_dir() {
# Note: Keep in sync with buildDir defaults in CMakePresets.json
case "$1" in
"default")
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird"
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/release"
;;
"Debug")
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird-debug"
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/debug"
;;
"Sanitizer")
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird-sanitizers"
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/sanitizers"
;;
*)
echo "Unknown BUILD_PRESET: '$1'" >&2