summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2023-03-26 10:13:07 -0600
committerLinus Groh <mail@linusgroh.de>2023-03-28 09:18:50 +0100
commit840afbb55f70cf2d3bbbca63b4d161174e2de7ad (patch)
tree9f3661de74f28cbe695d53c1144962574b58f8dc /Documentation
parent1c01856021f1b2f80c83136b4a430691f21bbf92 (diff)
downloadserenity-840afbb55f70cf2d3bbbca63b4d161174e2de7ad.zip
Documentation: Add instructions for debugging Ladybird with Xcode
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/LadybirdBuildInstructions.md26
-rw-r--r--Documentation/Xcode_ladybird_Scheme.pngbin0 -> 95457 bytes
2 files changed, 25 insertions, 1 deletions
diff --git a/Documentation/LadybirdBuildInstructions.md b/Documentation/LadybirdBuildInstructions.md
index dcfec750d6..4a1c3b3ee7 100644
--- a/Documentation/LadybirdBuildInstructions.md
+++ b/Documentation/LadybirdBuildInstructions.md
@@ -34,7 +34,7 @@ nix-shell ladybird.nix
On macOS:
-Note that XCode 13.x does not have sufficient C++20 support to build ladybird. XCode 14.x or clang from homebrew may be required to successfully build ladybird.
+Note that Xcode 13.x does not have sufficient C++20 support to build ladybird. Xcode 14.x or clang from homebrew may be required to successfully build ladybird.
```
xcode-select --install
@@ -119,6 +119,30 @@ export SERENITY_SOURCE_DIR=$(realpath ../)
./Build/ladybird/ladybird # or, in macOS: open ./Build/ladybird/ladybird.app
```
+### Debugging with Xcode on macOS
+
+The `serenity.sh` build script does not know how to generate Xcode projects, so creating the project must be done manually.
+To be compatible with the script, a few extra options are required. If there is a previous Lagom build directory, CMake will likely complain that the generator has changed.
+
+```
+cmake -GXcode -S Meta/Lagom -B Build/lagom -DBUILD_LAGOM=ON -DENABLE_LAGOM_LADBIRD=ON
+```
+
+Alternatively, if you don't need your ladybird build to be compatible with `serenity.sh`, you can use Ladybird as the source directory like so:
+
+```
+cmake -GXcode -S Ladybird -B Build/ladybird
+```
+
+After generating an Xcode project into the specified build directory, you can open `ladbyird.xcodeproj` in Xcode. The project has a ton of targets, many of which are generated code.
+The only target that needs a scheme is the ladybird app bundle.
+
+In order for the application to launch properly through Xcode, the `SERENITY_SOURCE_DIR` environment variable must be set to your serenity checkout in the ladybird scheme, per the
+screenshot below. The same is true for profiling the application in Instruments. Future updates might fill out the application bundle such that the environment variable is not required.
+
+![Modify Scheme...](Xcode_ladybird_Scheme.png)
+
+
### Building on OpenIndiana
OpenIndiana needs some extra environment variables set to make sure it finds all the executables
diff --git a/Documentation/Xcode_ladybird_Scheme.png b/Documentation/Xcode_ladybird_Scheme.png
new file mode 100644
index 0000000000..60d17d28d9
--- /dev/null
+++ b/Documentation/Xcode_ladybird_Scheme.png
Binary files differ