Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
2155b63
Add boringssl rules.
jonsimantov Dec 7, 2020
8e01d52
Patch boringssl to look like openssl.
jonsimantov Dec 7, 2020
be3173b
Force boringssl for curl build.
jonsimantov Dec 8, 2020
5562af2
Merge branch 'feature/fix-corrupt-mac-libs' into feature/js-switch-to…
jonsimantov Dec 8, 2020
8656c5b
Merge branch 'feature/fix-corrupt-mac-libs' into feature/js-switch-to…
jonsimantov Dec 8, 2020
90912c2
Populate the boringssl aliases with paths to the built libs.
jonsimantov Dec 8, 2020
23f1e1e
Install golang (required for boringssl) in prereqs.
jonsimantov Dec 8, 2020
1b15f97
Additional work to get boringssl to be used by all deps.
jonsimantov Dec 8, 2020
9f56b89
Move boringssl declares earlier.
jonsimantov Dec 8, 2020
86c27f1
Merge branch 'dev' into feature/js-switch-to-boringssl
jonsimantov Dec 9, 2020
3d96595
Fix spelling of Nanopb library.
jonsimantov Dec 9, 2020
56fb379
Merge branch 'feature/js-switch-to-boringssl' of https://github.com/f…
jonsimantov Dec 9, 2020
5f3138b
Fix packaging script to rename dependencies in *all* libraries, not j…
jonsimantov Dec 9, 2020
75c4ee5
Don't build boringssl on desktop.
jonsimantov Dec 9, 2020
e257fc6
Try the newer binutils again.
jonsimantov Dec 9, 2020
091b16d
Don't use if(DESKTOP) in external_rules.cmake
jonsimantov Dec 9, 2020
8019d82
Make BoringSSL build cross-platform and propagate some build flags to
jonsimantov Dec 9, 2020
334e94c
Fix OSX architecture to not emit the flag if it's blank.
jonsimantov Dec 9, 2020
692b59e
Disable an MSVC warning-as-error that boringssl triggers.
jonsimantov Dec 9, 2020
62a9104
Merge branch 'feature/js-switch-to-boringssl' of https://github.com/f…
jonsimantov Dec 9, 2020
5526066
For BoringSSL, only build the ssl and crypto targets.
jonsimantov Dec 9, 2020
459b2dd
Remove flag to disable warning.
jonsimantov Dec 9, 2020
1ee06fb
Set no-asm mode for boringssl in the main package as well.
jonsimantov Dec 9, 2020
9886184
Rename Curl option for Windows that changed names in the newer version.
jonsimantov Dec 9, 2020
db060cb
Don't build CURL tests.
jonsimantov Dec 9, 2020
972a2cc
Pass MSVC runtime flags directly to sub-build.
jonsimantov Dec 9, 2020
3685d0b
Move openssl-specific cmake subbuild options out, in case we use addi…
jonsimantov Dec 9, 2020
c164701
Pass along Linux c++11 ABI option, and MSVC runtime.
jonsimantov Dec 9, 2020
83b6bf9
Pass along Linux c++11 ABI option, and MSVC runtime.
jonsimantov Dec 9, 2020
85151d5
Revert "Pass MSVC runtime flags directly to sub-build."
jonsimantov Dec 9, 2020
b1562c0
Merge branch 'feature/js-switch-to-boringssl' of https://github.com/f…
jonsimantov Dec 9, 2020
84002a6
Fix cmake format issue.
jonsimantov Dec 9, 2020
ef11889
Fix cmake.
jonsimantov Dec 9, 2020
6c705b3
Fix subbuild flags and add generator.
jonsimantov Dec 9, 2020
86202ff
Change strequals to strequal
jonsimantov Dec 9, 2020
00e7aa8
Add C++11 ABI option to main CMake file, and fix stdlib.h include file
jonsimantov Dec 9, 2020
fa063b4
Get the correct ssl and crypto path on Windows.
jonsimantov Dec 9, 2020
31f5ca1
Swap the library order, as ssl needs to be linked before crypto.
jonsimantov Dec 9, 2020
06e457c
Fix the link order of libssl.a and libcrypto.a, which for some reason
jonsimantov Dec 9, 2020
c6e7c01
Fix extraneous libcrypto linkage.
jonsimantov Dec 9, 2020
df68f32
Repeat the same SSL workaround for Firebase C++ tests also.
jonsimantov Dec 9, 2020
284b5f5
Fix target link libraries for ssl/crypto.
jonsimantov Dec 9, 2020
a63f09a
Remove workaround since now the imported OpenSSL::SSL library is set to
jonsimantov Dec 9, 2020
e16bdc8
Fix database test dependency for boringssl.
jonsimantov Dec 9, 2020
5dbdc00
Add additional dependencies for app, required for unit tests building
jonsimantov Dec 10, 2020
d486c8e
Clean up platform-specific dependencies - we only need crypt32 on
jonsimantov Dec 10, 2020
b6d505d
Fix Windows generated package names to be merged in.
jonsimantov Dec 10, 2020
2af8037
Fix bad ssl library prefix in packaging script, and make the grpc libs
jonsimantov Dec 10, 2020
0481990
Fix database libcrypto dependendency
jonsimantov Dec 10, 2020
fea8495
Fix linux 32-bit build error due to cflags mis-setting.
jonsimantov Dec 10, 2020
91afab6
On Windows, the cmake subbuild needs to be passed --config Release for
jonsimantov Dec 10, 2020
e7812a2
Turn on verbose mode for all builds.
jonsimantov Dec 10, 2020
8eec1a2
Turn on verbose mode in CI build, and turn off in packaging build.
jonsimantov Dec 10, 2020
91b2303
Remove openssl from vcpkg list, as it's causing tests to use it rather
jonsimantov Dec 10, 2020
7302e31
Change around dependencies for libssl and libcrypto on Windows.
jonsimantov Dec 10, 2020
148c9c2
Add some diagnostics to detect if the openssl library changes, and also
jonsimantov Dec 10, 2020
c110209
Add a workaround to copy the built BoringSSL libraries to
jonsimantov Dec 10, 2020
52bca9c
Fix workaround path.
jonsimantov Dec 10, 2020
a6f0220
Remove the code to only build boringssl once.
jonsimantov Dec 10, 2020
7a7babf
Only build boringssl in the cmake configure step, not during the build
jonsimantov Dec 10, 2020
ce1e6ef
Cleaned up the openssl/boringssl definitions a bit.
jonsimantov Dec 10, 2020
fa15d8d
Remove extra checks on boringssl changing, which breaks non-desktop
jonsimantov Dec 10, 2020
5479fe9
Inspect all built libraries, not just firebase ones.
jonsimantov Dec 10, 2020
ddd952e
Also specify CMAKE_MSVC_RUNTIME_LIBRARY for sub-build.
jonsimantov Dec 10, 2020
050b869
Attempt to fix setting MSVC runtime for sub-build.
jonsimantov Dec 10, 2020
c365615
Also try MSVC_RUNTIME_LIBRARY
jonsimantov Dec 10, 2020
78a1d13
Cleaned up the MSVC runtime passing to subbuild.
jonsimantov Dec 10, 2020
7c291af
Fix badly-formatted comment.
jonsimantov Dec 10, 2020
aa7cb0e
Add CFLAGS back in for windows.
jonsimantov Dec 10, 2020
8158b25
Fix another cmake typo.
jonsimantov Dec 10, 2020
59232cb
Remove verbose output from github workflow.
jonsimantov Dec 10, 2020
c326461
Merge branch 'dev' into feature/js-switch-to-boringssl
jonsimantov Dec 11, 2020
787c744
Address PR comments by adding some comments and making a few minor ch…
jonsimantov Dec 11, 2020
9a6208d
Fix bad conditional.
jonsimantov Dec 11, 2020
8803578
Added a comment about tweaking the files on desktop after download.
jonsimantov Dec 11, 2020
1f8dfd3
Add FIREBASE_USE_BORINGSSL option, off by default but on for standalo…
jonsimantov Dec 11, 2020
628cb6e
Fix boringSSL path when linking SDK from source.
jonsimantov Dec 14, 2020
5ca920c
Add option to integration_tests workflow to build tests using openssl…
jonsimantov Dec 14, 2020
559ba8e
Reworded parameter.
jonsimantov Dec 14, 2020
98652b2
Move SSL parameter above optional params.
jonsimantov Dec 14, 2020
8a27f75
Rephrased comment
jonsimantov Dec 14, 2020
11a9b5c
Add SSL variant to job name.
jonsimantov Dec 14, 2020
04fb042
Remove extraneous ADDITIONAL_LIBS variable, which was used in an earl…
jonsimantov Dec 14, 2020
587d96c
Fix build integration tests on Windows.
jonsimantov Dec 14, 2020
b8a1b2b
Also ensure openssl is installed by prereqs script.
jonsimantov Dec 14, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cpp-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
binutils_version: "2.35.1"
- os: macos-latest
tools_platform: darwin
# On Mac, use an older Binutils to avoid corrupted libraries.
binutils_version: "2.28.1"
# Binutils 2.35.1 released Sep 19, 2020
binutils_version: "2.35.1"
steps:
- name: setup Xcode version (macos)
if: runner.os == 'macOS'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
python scripts/gha/install_prereqs_desktop.py

- name: Build SDK
shell: bash
run: |
python scripts/gha/build_desktop.py --build_tests --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --msvc_runtime_library "${{ matrix.msvc_runtime }}"

Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: 'CSV of VMs to run on'
default: 'ubuntu-latest,windows-latest,macos-latest'
required: true
desktop_ssl_variants:
description: 'CSV of desktop SSL variants to use'
default: 'openssl,boringssl'
required: true
android_device:
description: 'Android device model'
default: 'flame'
Expand All @@ -36,6 +40,7 @@ jobs:
outputs:
matrix_os: ${{ steps.set-matrix-os.outputs.matrix_os }}
matrix_platform: ${{ steps.set-matrix-os.outputs.matrix_platform }}
matrix_ssl: ${{ steps.set-matrix-os.outputs.matrix_ssl }}
steps:
- id: set-matrix-os
# e.g. 'ubuntu-latest,macos-latest' -> '["ubuntu-latest","macos-latest"]'
Expand All @@ -44,20 +49,27 @@ jobs:
echo "::set-output name=matrix_os::${OS_JSON}"
PLATFORM_JSON=[\"$(echo ${{ github.event.inputs.platforms }} | sed 's/,/","/g')\"]
echo "::set-output name=matrix_platform::${PLATFORM_JSON}"
SSL_JSON=[\"$(echo ${{ github.event.inputs.desktop_ssl_variants }} | sed 's/,/","/g')\"]
echo "::set-output name=matrix_ssl::${SSL_JSON}"
tests:
name: ${{ matrix.os }}-${{ matrix.target_platform }}
name: ${{ matrix.os }}-${{ matrix.target_platform }}-${{ matrix.ssl_variant }}
needs: prepare_matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.prepare_matrix.outputs.matrix_os) }}
target_platform: ${{ fromJson(needs.prepare_matrix.outputs.matrix_platform) }}
ssl_variant: ${{ fromJson(needs.prepare_matrix.outputs.matrix_ssl) }}
exclude:
- os: ubuntu-latest
target_platform: iOS
- os: windows-latest
target_platform: iOS
- target_platform: iOS
ssl_variant: boringssl
- target_platform: Android
ssl_variant: boringssl

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -117,8 +129,14 @@ jobs:
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"

- name: Build integration tests
shell: bash
run: |
python scripts/gha/build_testapps.py --t ${{ github.event.inputs.apis }} --p ${{ matrix.target_platform }} --output_directory ${{ github.workspace }} --use_vcpkg --noadd_timestamp
# Default SSL is openssl.
ssl_option=
if [[ "${{ matrix.ssl_variant }}" == "boringssl" ]]; then
ssl_option=--cmake_flag=-DFIREBASE_USE_BORINGSSL=ON
fi
python scripts/gha/build_testapps.py --t ${{ github.event.inputs.apis }} --p ${{ matrix.target_platform }} --output_directory ${{ github.workspace }} --use_vcpkg --noadd_timestamp ${ssl_option}

- name: Run desktop integration tests
if: matrix.target_platform == 'Desktop' && !cancelled()
Expand Down
120 changes: 101 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ option(FIREBASE_CPP_BUILD_PACKAGE
"Bundle the Firebase C++ libraries into a zip file." OFF)
option(FIREBASE_CPP_USE_PRIOR_GRADLE_BUILD
"When building with Gradle, use the previously built libraries." OFF)
option(FIREBASE_USE_BORINGSSL
"Build against BoringSSL instead of using your system's OpenSSL." OFF)

set(FIREBASE_ANDROID_STL "" CACHE STRING "STL implementation to use.")
if (NOT FIREBASE_ANDROID_STL STREQUAL "")
Expand Down Expand Up @@ -115,6 +117,13 @@ else()
set(DESKTOP OFF)
endif()

if(DESKTOP AND NOT MSVC AND NOT APPLE)
# Linux-specific option.
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()

# Set directories needed by the Firebase subprojects
# Directory to store generated files.
set(FIREBASE_GEN_FILE_DIR ${CMAKE_BINARY_DIR}/generated)
Expand Down Expand Up @@ -174,6 +183,87 @@ else()
set(FIRESTORE_SOURCE_DIR ${FIREBASE_BINARY_DIR}/external/src/firestore)
endif()

if(DESKTOP)
# Use the static versions of the OpenSSL libraries.
set(OPENSSL_USE_STATIC_LIBS TRUE)
if (MSVC)
# Get the correct version of the OpenSSL libraries based on building for MT.
if ("${CMAKE_CXX_FLAGS_DEBUG}" MATCHES "/MTd" OR
"${CMAKE_CXX_FLAGS_RELEASE}" MATCHES "/MT")
set(OPENSSL_MSVC_STATIC_RT TRUE)
else()
set(OPENSSL_MSVC_STATIC_RT FALSE)
endif()
endif()

if(FIREBASE_USE_BORINGSSL)
# Use BoringSSL instead of OpenSSL.
set(BORINGSSL_ROOT_DIR ${PROJECT_BINARY_DIR}/external/src/boringssl/src CACHE STRING "" FORCE)
set(BORINGSSL_BINARY_DIR ${PROJECT_BINARY_DIR}/external/src/boringssl-build CACHE STRING "" FORCE)
set(OPENSSL_ROOT_DIR ${BORINGSSL_ROOT_DIR} CACHE STRING "" FORCE)

# The call below to build_external_dependencies will make sure that these
# libraries exist before the libraries are imported via add_library.
if (MSVC)
if (CMAKE_BUILD_TYPE)
set(BORINGSSL_LIB_SUBDIR "${CMAKE_BUILD_TYPE}")
else()
set(BORINGSSL_LIB_SUBDIR "Debug")
endif()
set(OPENSSL_SSL_LIBRARY ${BORINGSSL_BINARY_DIR}/ssl/${BORINGSSL_LIB_SUBDIR}/ssl.lib CACHE FILEPATH "" FORCE)
set(OPENSSL_CRYPTO_LIBRARY ${BORINGSSL_BINARY_DIR}/crypto/${BORINGSSL_LIB_SUBDIR}/crypto.lib CACHE FILEPATH "" FORCE)
else()
set(OPENSSL_SSL_LIBRARY ${BORINGSSL_BINARY_DIR}/ssl/libssl.a CACHE FILEPATH "" FORCE)
set(OPENSSL_CRYPTO_LIBRARY ${BORINGSSL_BINARY_DIR}/crypto/libcrypto.a CACHE FILEPATH "" FORCE)
endif()
endif()
endif()


if(DESKTOP)
message(STATUS "Building external project dependencies...")
build_external_dependencies()
message(STATUS "Build of external project dependencies complete.")

if(FIREBASE_USE_BORINGSSL)
set(OPENSSL_FOUND TRUE CACHE BOOL "" FORCE)
set(OPENSSL_NO_ASM TRUE) # Force cross-platform BoringSSL, no ASM.
set(OPENSSL_INCLUDE_DIR ${BORINGSSL_ROOT_DIR}/include CACHE PATH "" FORCE)
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
set(OPENSSL_VERSION '1.1.0' CACHE STRING "" FORCE)

add_library(OpenSSL::SSL STATIC IMPORTED)
add_library(OpenSSL::Crypto STATIC IMPORTED)
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES OpenSSL::Crypto
)

set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}"
)
# Now if we do find_package(OpenSSL) it should give us BoringSSL.
find_package(OpenSSL)

if(NOT "${OPENSSL_INCLUDE_DIR}" MATCHES boringssl OR
NOT "${OPENSSL_SSL_LIBRARY}" MATCHES boringssl OR
NOT "${OPENSSL_CRYPTO_LIBRARY}" MATCHES boringssl)
message(FATAL_ERROR "BoringSSL was not configured correctly.\nINCLUDE_DIR=${OPENSSL_INCLUDE_DIR}\nSSL_LIBRARY=${OPENSSL_SSL_LIBRARY}\nCRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}")
endif()
else()
# Don't use BoringSSL, use OpenSSL. If you are linking against the libraries directly
# from source, you probably want this instead.
#
# If the find_package fails to find OpenSSL, set OPENSSL_ROOT_DIR to OpenSSL'S install
# location on your system.
find_package(OpenSSL REQUIRED)
endif()
endif()

# Include Firestore's external build early to resolve conflicts on packages.
if(FIRESTORE_USE_EXTERNAL_CMAKE_BUILD)
set(FIRESTORE_BINARY_DIR ${FIRESTORE_SOURCE_DIR}-build)
Expand Down Expand Up @@ -223,37 +313,28 @@ endif()

# Some of the external libraries are not used for mobile.
if(DESKTOP)
# Use the static versions of the OpenSSL libraries.
set(OPENSSL_USE_STATIC_LIBS TRUE)
if (MSVC)
# Get the correct version of the OpenSSL libraries based on building for MT.
if ("${CMAKE_CXX_FLAGS_DEBUG}" MATCHES "/MT" OR
"${CMAKE_CXX_FLAGS_RELEASE}" MATCHES "/MT")
set(OPENSSL_MSVC_STATIC_RT TRUE)
else()
set(OPENSSL_MSVC_STATIC_RT FALSE)
endif()
endif()

# Build curl as a static library
set(CURL_STATICLIB ON CACHE BOOL "")
if (WIN32)
set(CMAKE_USE_WINSSL ON CACHE BOOL "")
# Enable Windows native SSL/TLS in libcurl.
set(CMAKE_USE_SCHANNEL ON CACHE BOOL "")
endif()

# Current Curl library defaults to requiring some dependencies we don't need, disable them.
set(CMAKE_USE_LIBSSH2 OFF)
set(HTTP_ONLY ON)
set(BUILD_TESTING OFF)
add_external_library(curl)

add_external_library(libuv)

find_package(OpenSSL)

add_external_library(zlib)

add_external_library(uWebSockets)

# Binutils on Mac doesn't support thread-local storage (required by
# websockets), but because we only use websockets via the scheduler,
# we don't need it.

# websockets), but because we only use websockets via the scheduler, we don't
# need it. Deactivate this by blanking out the __thread keyword.
set(websockets_additional_defines "-D__thread=")

# uWebSockets does not come with a CMakeLists file, so define the target.
Expand Down Expand Up @@ -304,7 +385,8 @@ if(DESKTOP)
)
target_link_libraries(libuWS
PRIVATE
${OPENSSL_LIBRARIES}
OpenSSL::SSL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since ssl->crypto dependency is captured already in ssl, do we need to specify these 2 libraries separately here?

OpenSSL::Crypto
uv_a
zlibstatic
)
Expand Down
1 change: 1 addition & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ target_compile_definitions(firebase_app
PRIVATE
-DINTERNAL_EXPERIMENTAL=1
)

# firebase_app has a dependency on flatbuffers, which needs to be included.
target_link_libraries(firebase_app
PRIVATE
Expand Down
8 changes: 7 additions & 1 deletion app/rest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ target_compile_definitions(firebase_rest_lib
"${rest_additional_defines}"
)

set(FIREBASE_CURL_DEPENDENCY libcurl)
if (MSVC)
# libcurl on Windows depends on internal Windows SSL via its crypt32 library.
set(FIREBASE_CURL_DEPENDENCY ${FIREBASE_CURL_DEPENDENCY} crypt32)
endif()

# firebase_rest_lib has a dependency on flatbuffers, which needs to be included.
target_link_libraries(firebase_rest_lib
PUBLIC
firebase_app
PRIVATE
flatbuffers
libcurl
${FIREBASE_CURL_DEPENDENCY}
zlibstatic
${CMAKE_DL_LIBS}
)
Expand Down
46 changes: 36 additions & 10 deletions build_scripts/desktop/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,28 @@ fi

# Library dependencies to merge. Each should be a whitespace-delimited list of path globs.
readonly deps_firebase_app="
*/${prefix}firebase_instance_id*${suffix}.${ext}
*/${prefix}firebase_rest_lib${suffix}.${ext}
*/${prefix}firebase_instance_id*.${ext}
*/${prefix}firebase_rest_lib.${ext}
"
readonly deps_hidden_firebase_app="
*/${subdir}${prefix}curl${suffix}.${ext}
*/${subdir}${prefix}flatbuffers${suffix}.${ext}
*/curl-build/lib/${subdir}libcurl${suffix}.${ext}
*/${subdir}${prefix}flatbuffers.${ext}
*/zlib-build/${subdir}${prefix}z.${ext}
*/zlib-build/${subdir}zlibstatic*.${ext}
*/vcpkg-libs/libcrypto.${ext}
*/vcpkg-libs/libssl.${ext}
*/boringssl-build/crypto/${subdir}${prefix}crypto.${ext}
*/boringssl-build/ssl/${subdir}${prefix}ssl.${ext}
*/firestore-build/*/leveldb-build*/${prefix}*.${ext}
*/firestore-build/*/nanopb-build*/${prefix}*.${ext}
"
readonly deps_hidden_firebase_database="
*/${subdir}${prefix}uv_a${suffix}.${ext}
*/${subdir}${prefix}libuWS${suffix}.${ext}
*/${subdir}${prefix}uv_a.${ext}
*/${subdir}${prefix}libuWS.${ext}
"
readonly deps_hidden_firebase_firestore="
*/firestore-build/Firestore/*/${prefix}*.${ext}
*/firestore-build/*/grpc-build*/${prefix}*.${ext}
*/firestore-build/*/grpc-build/${subdir}${prefix}*.${ext}
*/firestore-build/*/grpc-build/third_party/cares/*${subdir}${prefix}*.${ext}
*/firestore-build/*/grpc-build/third_party/abseil-cpp/*${subdir}${prefix}*.${ext}
"

# List of C++ namespaces to be renamed, so as to not conflict with the
Expand Down Expand Up @@ -281,13 +283,31 @@ for product in ${product_list[*]}; do
deps_hidden+="${found}"
done
done
if [[ "${product}" != "app" ]]; then
# For any library other than app, also rename some symbols that were already renamed in app
# that are used by other libraries (e.g. zlib is used in Firestore).
for dep in ${deps_hidden_firebase_app}; do
for found in $(find . -path ${dep}); do
if [[ ! -z ${deps_hidden} ]]; then deps_hidden+=","; fi
deps_hidden+="${found}"
done
done
fi
echo -n "${libfile_out}"
if [[ ! -z ${deps_basenames[*]} ]]; then
echo -n " <- ${deps_basenames[*]}"
echo -n " <- ${deps[*]}"
fi
echo
outfile="${full_output_path}/${libfile_out}"
rm -f "${outfile}"
if [[ ${verbose} -eq 1 ]]; then
echo "${python_cmd}" "${merge_libraries_script}" \
${merge_libraries_params[*]} \
--output="${outfile}" \
--scan_libs="${allfiles}" \
--hide_c_symbols="${deps_hidden}" \
${libfile_src} ${deps[*]}
fi
"${python_cmd}" "${merge_libraries_script}" \
${merge_libraries_params[*]} \
--output="${outfile}" \
Expand All @@ -296,3 +316,9 @@ for product in ${product_list[*]}; do
${libfile_src} ${deps[*]}
done
cd "${run_path}"

# Copy Firestore core headers into the package's include directory.
mkdir -p "${output_package_path}/include/firebase/firestore"
cp -av \
"${built_sdk_path}/external/src/firestore/Firestore/core/include/firebase/firestore/"* \
"${output_package_path}/include/firebase/firestore"
1 change: 1 addition & 0 deletions cmake/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include(firestore)

# Some of the external dependencies are not needed for mobile.
if (${FIREBASE_EXTERNAL_PLATFORM} STREQUAL "DESKTOP")
include(boringssl)
include(curl)
include(libuv)
include(leveldb)
Expand Down
Loading