From 4836734b4bd941a7a0547e661b7de00d358f80a8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 18:38:40 +0000 Subject: [PATCH 1/2] Update C++ standard to C++17 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aea6d80a34..66b1027f15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ cmake_minimum_required (VERSION 3.1) -set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version. # Turn on virtual folders for visual studio From a415898daecab9b7567f2054d651198ffee7bac4 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 20:58:44 +0000 Subject: [PATCH 2/2] Force C++17 for MSVC to fix Firestore linkage errors --- CMakeLists.txt | 4 ++++ STYLE_GUIDE.md | 6 +++--- release_build_files/readme.md | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66b1027f15..fe69a2f4cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,10 @@ cmake_minimum_required (VERSION 3.1) set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version. +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") +endif() + # Turn on virtual folders for visual studio set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index a141ee0b66..4bfdb0983d 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -100,10 +100,10 @@ Examples of typical Do's and Don'ts: they result in hard to understand errors, and can make correct use of your API harder to understand. -* Utilize C++11 features where appropriate. This project has adopted C++11, +* Utilize C++17 features where appropriate. This project has adopted C++17, and features such as `std::unique_ptr`, `std::shared_ptr`, - `std::make_unique`, and `std::move` are encouraged to improve code safety - and readability. However, avoid features from C++14 or newer standards. + `std::make_unique`, `std::move`, and `std::optional` are encouraged to + improve code safety and readability. * Go easy on objectifying everything, and prefer value types. In languages like Java it is common to give each "concept" your API deals with its own diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 0ecbafb0d9..6366fd8336 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -72,7 +72,7 @@ libs/windows | Windows static libraries (desktop or stub ## C++ Language Standards -The Firebase C++ SDK supports the C++14 language standard. For more information, +The Firebase C++ SDK supports the C++17 language standard. For more information, please see our [C++ Language Standard Support Criteria](https://opensource.google/documentation/policies/cplusplus-support#c_language_standard). @@ -677,6 +677,7 @@ code. ## Release Notes ### Upcoming Release - Changes + - General: Updated the minimum C++ standard from C++14 to C++17. - iOS: Added an option to explicitly specify your app's `AppDelegate` class name via the `FirebaseAppDelegateClassName` key in `Info.plist`. This provides a more direct way for Firebase to interact with your specified