diff --git a/AGENTS.md b/AGENTS.md index fce803dc12..abd2ee35f6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,8 +33,10 @@ instructions for your specific platform. * **CMake**: Version 3.7 or newer. * **Python**: Version 3.7 or newer. * **Abseil-py**: Python package. -* **OpenSSL**: Required for Realtime Database and Cloud Firestore (especially - for desktop builds). +* **OpenSSL**: Required for desktop builds, unless you build with the + `-DFIREBASE_USE_BORINGSSL=YES` cmake flag. +* **libsecret-1-dev**: (Linux Desktop) Required for secure credential storage. + Install using `sudo apt-get install libsecret-1-dev`. * **Android SDK & NDK**: Required for building Android libraries. `sdkmanager` can be used for installation. CMake for Android (version 3.10.2 recommended) is also needed. @@ -42,6 +44,12 @@ instructions for your specific platform. Android builds on Windows. * **Cocoapods**: Required for building iOS or tvOS libraries. +To build for Desktop, you can install prerequisites by running the following +script in the root of the repository: `scripts/gha/install_prereqs_desktop.py` + +To build for Android, you can install prerequisites by running the following +script in the root of the repository: `build_scripts/android/install_prereqs.sh` + ## Building the SDK The SDK uses CMake for C++ compilation and Gradle for Android-specific parts. @@ -50,15 +58,16 @@ The SDK uses CMake for C++ compilation and Gradle for Android-specific parts. 1. Create a build directory (e.g., `mkdir desktop_build && cd desktop_build`). 2. Run CMake to configure: `cmake ..` - * For iOS: - `cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/ios.cmake ..` - Note: iOS setup typically requires both including Firebase pods (via - `Podfile`) and linking the `.framework` files from the C++ SDK - distribution. - * For tvOS: - `cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/apple.toolchain.cmake -DPLATFORM=TVOS ..` + * For Desktop: Run as is. You can use BORINGSSL instead of OpenSSL (for fewer + system dependencies with the `-DFIREBASE_USE_BORINGSSL=YES` parameter. + * For iOS, include the `-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/ios.cmake` + parameter. This requires running on a Mac build machine. 3. Build specific targets: `cmake --build . --target firebase_analytics` (replace `firebase_analytics` with the desired library). + Or omit the entire `--target` parameter to build all targets. + +You can also use the `scripts/gha/build_desktop.py` script to build the full +desktop SDK. Refer to `README.md` for details on CMake generators and providing custom third-party dependency locations. @@ -76,6 +85,9 @@ This command should be run from the root of the repository. Proguard files are generated in each library's build directory (e.g., `analytics/build/analytics.pro`). +You can build the entire SDK for Android by running `./gradlew build` or +`build_scripts/android/build.sh`. + ### Desktop Platform Setup Details When setting up for desktop, if you are using an iOS