Some portions of this repository are portable beyond iOS and can be built using CMake.
You need:
For dependencies:
You need Xcode, which you can get from the Mac App Store.
You can get other development tools via homebrew. Adjust as needed for other package managers.
brew install cmake
brew install golang
brew install ccache # optional
brew install ninja # optional
gem install cocoapods # may need sudo
Note that CocoaPods is only needed for its ruby library, no Podfiles actually
need to be set up and no pod install
is required for the CMake build.
If you're on a relatively recent Linux, the system-provided CMake may be sufficient.
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install ccache # optional
sudo apt-get install ninja-build # optional
sudo apt-get install golang
You need Visual Studio. The 2017 Community edition building for x64 gets regular testing. We're working on support for Visual Studio 2015.
An easy way to get development tools is via Chocolatey.
choco install git
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install ninja
# Build scripts use bash and python
choco install msys2
# Required for building gRPC and its dependencies
choco install activeperl
choco install golang
choco install nasm
# Optional: can speed up builds
choco install openssl
CMake builds out-of source, so create a separate build directory for the target you want to work on.
The first time you build, it will download all dependencies of the project so it might take a while.
The basic shape of the build is to:
On most systems that looks like this:
mkdir build
cd build
cmake ..
cmake --build .
cmake --build . --target test
Standard CMake flags:
-G Ninja
-- build with Ninja instead of the default.-DCMAKE_BUILD_TYPE=Release
-- optimized buildDependencies:
-DOPENSSL_ROOT_DIR=path/to/openssl
-- where to find a pre-built OpenSSL,
if you prefer that over the default BoringSSL. See FindOpenSSL.cmake
in
your CMake distribution.-DZLIB_ROOT=path/to/zlib
-- where to find a pre-built zlib, if you prefer
that. See FindZLIB.cmake
in your CMake distribution.Firebase-specific goodies:
-DFIREBASE_DOWNLOAD_DIR:PATH=.downloads
-- put downloaded files outside
the build tree.-DWITH_ASAN=ON
-- enable the address sanitizer (Clang, GCC)-DWITH_TSAN=ON
-- enable the thread sanitizer (Clang, GCC)-DWITH_UBSAN=ON
-- enable the undefined behavior sanitizer (Clang, GCC)For example:
On Mac or Linux:
cmake -H. -Bbuild -G Ninja -DFIREBASE_DOWNLOAD_DIR:PATH=$HOME/.downloads
cd build
ninja && ninja test
On Windows:
mkdir %USERPROFILE%\AppData\LocalLow\CMake
cmake -H. -Bbuild -G Ninja ^
-DFIREBASE_DOWNLOAD_DIR:PATH=%USERPROFILE%\AppData\LocalLow\CMake ^
-DOPENSSL_ROOT_DIR:Path="c:\Program Files\OpenSSL-Win64"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。