Преглед изворни кода

Documentation: Add instructions for debugging Ladybird with Xcode

Andrew Kaster пре 2 година
родитељ
комит
840afbb55f
2 измењених фајлова са 25 додато и 1 уклоњено
  1. 25 1
      Documentation/LadybirdBuildInstructions.md
  2. BIN
      Documentation/Xcode_ladybird_Scheme.png

+ 25 - 1
Documentation/LadybirdBuildInstructions.md

@@ -34,7 +34,7 @@ nix-shell ladybird.nix
 
 
 On macOS:
 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
 xcode-select --install
@@ -119,6 +119,30 @@ export SERENITY_SOURCE_DIR=$(realpath ../)
 ./Build/ladybird/ladybird # or, in macOS: open ./Build/ladybird/ladybird.app
 ./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
 ### Building on OpenIndiana
 
 
 OpenIndiana needs some extra environment variables set to make sure it finds all the executables
 OpenIndiana needs some extra environment variables set to make sure it finds all the executables

BIN
Documentation/Xcode_ladybird_Scheme.png