with one click
firebase-cpp-builder
// Instructions and workflows for building the Firebase C++ SDK natively. Use this skill when you need to compile the C++ SDK per-product (e.g., auth, database) across different platforms (Desktop, iOS, Android).
// Instructions and workflows for building the Firebase C++ SDK natively. Use this skill when you need to compile the C++ SDK per-product (e.g., auth, database) across different platforms (Desktop, iOS, Android).
Formatting workflow for C++ and Objective-C code in the Firebase C++ SDK. Use when modifying source code and ensuring compliance with the repository's clang-format rules.
Workflows for locally building and running test apps for the Firebase C++ SDK across Android, iOS, and Desktop. Use when validating new features or bug fixes.
| name | firebase-cpp-builder |
| description | Instructions and workflows for building the Firebase C++ SDK natively. Use this skill when you need to compile the C++ SDK per-product (e.g., auth, database) across different platforms (Desktop, iOS, Android). |
This skill provides instructions on how to build the Firebase C++ SDK directly
from source, specifically tailored for building individual products (like
firebase_auth, firebase_database, etc.).
Before building, ensure that your Python environment is set up with all required dependencies, especially if you plan to use helper scripts:
pip install -r scripts/gha/python_requirements.txt to install required libraries (such as attrs, absl-py, etc.).The easiest way to build for Desktop is to use the Python helper script from the repository root:
python3 scripts/gha/build_desktop.py -a <arch> --build_dir <dir>
(Plenty more options: run python3 scripts/gha/build_desktop.py --help for
info.)
Alternatively, you can build manually with CMake. The build process will automatically download necessary dependencies.
mkdir desktop_build
cd desktop_build
cmake ..
cmake --build . --target firebase_<product> -j
Example: cmake --build . --target firebase_auth -j
For iOS, you can use the convenience script from the repository root:
./build_scripts/ios/build.sh -b ios_build_dir -s .
(Run ./build_scripts/ios/build.sh -h for more options.)
Alternatively, you can use CMake's native Xcode generator manually. Ensure you have CocoaPods installed if building products that depend on iOS SDK Pods.
mkdir ios_build
cd ios_build
cmake .. -G Xcode -DCMAKE_SYSTEM_NAME=iOS
cmake --build . --target firebase_<product> -j
Alternatively, you can build XCFrameworks using the helper script:
python3 scripts/gha/build_ios_tvos.py -s . -b ios_tvos_build
For Android, use the convenience script from the repository root:
./build_scripts/android/build.sh android_build_dir .
(You can also specify an STL variant with the 3rd parameter. Run the script without any parameters to see the usage.)
Alternatively, when building the Firebase C++ SDK manually for Android, the repository uses a Gradle wrapper where each product has its own subproject.
To build a specific product's AARs, run the gradle build task for that module:
./gradlew :<product>:build
Example: ./gradlew :auth:build or ./gradlew :database:build
Note that as part of the build process, each library generates a ProGuard file
in its build directory (e.g., <product>/build/<product>.pro).
When using CMake directly (for Desktop or iOS/tvOS), the targets are
consistently named firebase_<product>.
Common targets include:
firebase_appfirebase_analyticsfirebase_authfirebase_databasefirebase_firestorefirebase_functionsfirebase_messagingfirebase_remote_configfirebase_storagefirebase_auth vs auth)Different build tools use different naming conventions for products in this repository:
firebase_ (e.g., firebase_auth).:auth:build).build_desktop.py, build_testapps.py): Typically use the raw module name (e.g., --t auth).[!TIP] If you are unsure about the exact product name or supported flags, run Python scripts with
--help(e.g.,build_desktop.py --help). For shell scripts, run without parameters (Android) or with-h(iOS) to see usage.