Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
002136e
Add a couple of workarounds for Swift on Windows
compnerd Aug 4, 2023
b636756
GHA: add a custom build of firebase
compnerd Aug 7, 2023
5966d59
Update bcny-firebase.yml
compnerd Aug 17, 2023
7d9b1a1
Update bcny-firebase.yml
compnerd Aug 17, 2023
a25930c
Adding copy constructor for Firestore
brianmichel Aug 28, 2023
7e10724
Actually scope the changes correctly. (#3)
brianmichel Aug 28, 2023
449dad8
Update firestore_swift.cc
compnerd Aug 28, 2023
202d022
Update bcny-firebase.yml
compnerd Aug 31, 2023
4023d3e
Copy in firestore libs
brianmichel Sep 19, 2023
4135f29
Copy all lib files
brianmichel Sep 19, 2023
525211e
Update bcny-firebase.yml
compnerd Sep 30, 2023
95d3f3e
boringssl: disable C4746 for building boringssl on ARM64
compnerd Oct 20, 2023
df5f058
Update bcny-firebase.yml
compnerd Oct 20, 2023
2307235
boringssl: attempt to tweak the patch a bit further
compnerd Oct 20, 2023
4671335
Update bcny-firebase.yml
compnerd Oct 20, 2023
d9b6df3
build: propagate the python version
compnerd Oct 20, 2023
af01005
Ensure we pass our python path to CMake (#12)
brianmichel Nov 9, 2023
3cd53b1
GHA: disable flatc build
compnerd Nov 16, 2023
c6a696c
GHA: build and use flatc for the build
compnerd Nov 16, 2023
d76bbd4
GHA: pin flatbuffer to the same revision as the dependency
compnerd Nov 16, 2023
4ef92e8
Update bcny-firebase.yml
jeffdav Nov 29, 2023
6692a0d
Update CMakeLists.txt
compnerd Nov 29, 2023
b6a951c
Update bcny-firebase.yml
compnerd Nov 29, 2023
030b6bc
Update bcny-firebase.yml
compnerd Nov 29, 2023
d4f6970
Update bcny-firebase.yml
compnerd Nov 29, 2023
bd49521
Add using for some types to work around compiler crash SR70253 (#14)
hjyamauchi Dec 6, 2023
3e770ab
GHA: package up the content as a nuget package
compnerd Dec 7, 2023
313e3b4
GHA: add publish nuget package step for CI
compnerd Dec 8, 2023
4f3bf51
Update bcny-firebase.yml
compnerd Dec 14, 2023
30521a1
Update bcny-firebase.yml
compnerd Dec 18, 2023
dece3ca
Update bcny-firebase.yml
compnerd Dec 18, 2023
f6d6ee2
Override build settings to specify /Z7 instead of /Zi for embedded PD…
hyp Mar 6, 2024
2f70657
GHA: add Android builds for firebase-cpp-sdk
compnerd Mar 6, 2024
9e15887
Merge remote-tracking branch 'upstream/main' into compnerd/swift
compnerd Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
395 changes: 395 additions & 0 deletions .github/workflows/bcny-firebase.yml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

# Top level CMake file that defines the entire Firebase C++ SDK build.

if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()

cmake_minimum_required (VERSION 3.1)

set (CMAKE_CXX_STANDARD 14)
Expand Down
15 changes: 15 additions & 0 deletions app/src/include/firebase/future.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ class Future : public FutureBase {
/// when you set up the callback.
typedef void (*TypedCompletionCallback)(const Future<ResultType>& result_data,
void* user_data);
#if defined(__swift__)
// TODO(apple/swift#67662) indirect block parameters are unsupported
typedef void (*TypedCompletionCallback_SwiftWorkaround)(
const Future<ResultType>* result_data, void* user_data);
#endif

/// Construct a future.
Future() {}
Expand Down Expand Up @@ -464,6 +469,16 @@ class Future : public FutureBase {
inline void OnCompletion(TypedCompletionCallback callback,
void* user_data) const;

#if defined(__swift__)
// TODO(apple/swift#67662) indirect block parameters are unsupported
inline void OnCompletion_SwiftWorkaround(
TypedCompletionCallback_SwiftWorkaround callback, void* user_data) const {
OnCompletion([callback, user_data](const Future<ResultType>& future) {
callback(&future, user_data);
});
}
#endif

#if defined(FIREBASE_USE_STD_FUNCTION) || defined(DOXYGEN)
/// Register a single callback that will be called at most once, when the
/// future is completed.
Expand Down
1 change: 1 addition & 0 deletions auth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ build_flatbuffers("${flatbuffer_schemas}"
# Common source files used by all platforms
set(common_SRCS
src/auth.cc
src/auth_swift.cc
src/credential.cc
src/common.cc
src/common.h
Expand Down
26 changes: 26 additions & 0 deletions auth/src/auth_swift.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#define __swift__ 50000
#include "auth/src/include/firebase/auth.h"

#if FIREBASE_PLATFORM_WINDOWS
namespace firebase {
namespace auth {
Auth::Auth(const Auth &) noexcept = default;
}
} // namespace firebase
#endif
7 changes: 7 additions & 0 deletions auth/src/include/firebase/auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ class Auth {

~Auth();

#if defined(__swift__)
#if FIREBASE_PLATFORM_WINDOWS
// TODO(apple/swift#67288) support trivial C++ types with non-trivial dtors
Auth(const Auth&) noexcept;
#endif
#endif

/// Synchronously gets the cached current user, or returns an object where
/// is_valid() == false if there is none.
///
Expand Down
33 changes: 33 additions & 0 deletions build_scripts/windows/fix_cmake_debugflags.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Path to the CMakeLists.txt file
$filePath = $args[0]

# Lines to add after the line starting with "cmake_minimum_required"
$newLines = @(
'string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")',
'string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")',
'string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")',
'string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")'
)

# Read the content of the file
$content = Get-Content -Path $filePath

# New content holder
$newContent = @()

# Flag to check if lines are added
$linesAdded = $false

foreach ($line in $content) {
# Add the current line to new content
$newContent += $line

# Check if the line starts with "cmake_minimum_required" and add new lines after it
if ($line -match '^cmake_minimum_required' -and -not $linesAdded) {
$newContent += $newLines
$linesAdded = $true
}
}

# Write the new content back to the file
$newContent | Set-Content -Path $filePath
4 changes: 4 additions & 0 deletions cmake/external_rules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ function(build_external_dependencies)
# Propagate the PIC setting, as the dependencies need to match it
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE})
if(Python3_EXECUTABLE)
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
-DPython3_EXECUTABLE=${Python3_EXECUTABLE})
endif()
message(STATUS "Sub-configure options: ${CMAKE_SUB_CONFIGURE_OPTIONS}")
message(STATUS "Sub-build options: ${CMAKE_SUB_BUILD_OPTIONS}")

Expand Down
3 changes: 2 additions & 1 deletion firestore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(common_SRCS
src/common/field_path.cc
src/common/field_value.cc
src/common/firestore.cc
src/common/firestore_swift.cc
src/common/firestore_exceptions_common.h
src/common/futures.cc
src/common/futures.h
Expand Down Expand Up @@ -352,7 +353,7 @@ if(IOS)
set(FIREBASE_FIRESTORE_CORE_HEADER_DIR
${FIREBASE_POD_DIR}/Pods/FirebaseFirestoreInternal/Firestore/core/include
)

else()
# Desktop and Android get their public headers from the CMake build in
# firebase-ios-sdk.
Expand Down
26 changes: 26 additions & 0 deletions firestore/src/common/firestore_swift.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#define __swift__ 50000
#include "firestore/src/include/firebase/firestore.h"

#if FIREBASE_PLATFORM_WINDOWS
namespace firebase {
namespace firestore {
Firestore::Firestore(const Firestore &) noexcept = default;
}
} // namespace firebase
#endif
8 changes: 8 additions & 0 deletions firestore/src/include/firebase/firestore.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,15 @@ class Firestore {
* Deleted copy constructor; Firestore must be created with
* Firestore::GetInstance().
*/
#if defined(__swift__)
#if FIREBASE_PLATFORM_WINDOWS
Firestore(const Firestore& src) noexcept;
#else
Firestore(const Firestore& src) = delete;
#endif
#else
Firestore(const Firestore& src) = delete;
#endif

/**
* Deleted copy assignment operator; Firestore must be created with
Expand Down
9 changes: 9 additions & 0 deletions firestore/src/include/firebase/firestore/map_field_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ using MapFieldValue = std::unordered_map<std::string, FieldValue>;
/** @brief A map of `FieldValue`s indexed by field paths. */
using MapFieldPathValue = std::unordered_map<FieldPath, FieldValue>;

#if defined(__swift__)
// Reference the following types so that they are included in the CXX
// module. A workaround for deserialization cross reference compiler
// crashes https://github.com/apple/swift/issues/70253
using FieldValueVector = std::vector<FieldValue>;
using FieldValueVectorConstIterator = std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<FieldValue>>>;
using StringVectorConstIterator = std::vector<std::string>::const_iterator;
#endif

} // namespace firestore
} // namespace firebase

Expand Down
5 changes: 4 additions & 1 deletion scripts/git/patches/boringssl/0001-disable-warnings.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -197,6 +197,11 @@ elseif(MSVC)
@@ -197,6 +197,14 @@ elseif(MSVC)
# possible loss of data
"C4244" # 'function' : conversion from 'int' to 'uint8_t',
# possible loss of data
Expand All @@ -9,6 +9,9 @@
+ "C4191" # 'operator/operation' : unsafe conversion from 'type of
+ # expression' to 'type required'
+ "C5264" # 'const' variable is not used
+ "C4746" # volatile access of 'label' is subject to /volatile:<iso|ms>
+ # setting; consider using __iso_volatile_load/store intrinsic
+ # functions
"C4267" # conversion from 'size_t' to 'int', possible loss of data
"C4371" # layout of class may have changed from a previous version of the
# compiler due to better packing of member '...'