Skip to content

Commit a415898

Browse files
Force C++17 for MSVC to fix Firestore linkage errors
1 parent 4836734 commit a415898

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ cmake_minimum_required (VERSION 3.1)
1919
set (CMAKE_CXX_STANDARD 17)
2020
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.
2121

22+
if(MSVC)
23+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
24+
endif()
25+
2226
# Turn on virtual folders for visual studio
2327
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
2428

STYLE_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ Examples of typical Do's and Don'ts:
100100
they result in hard to understand errors, and can make correct use of
101101
your API harder to understand.
102102
103-
* Utilize C++11 features where appropriate. This project has adopted C++11,
103+
* Utilize C++17 features where appropriate. This project has adopted C++17,
104104
and features such as `std::unique_ptr`, `std::shared_ptr`,
105-
`std::make_unique`, and `std::move` are encouraged to improve code safety
106-
and readability. However, avoid features from C++14 or newer standards.
105+
`std::make_unique`, `std::move`, and `std::optional` are encouraged to
106+
improve code safety and readability.
107107
108108
* Go easy on objectifying everything, and prefer value types. In languages
109109
like Java it is common to give each "concept" your API deals with its own

release_build_files/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ libs/windows | Windows static libraries (desktop or stub
7272

7373
## C++ Language Standards
7474

75-
The Firebase C++ SDK supports the C++14 language standard. For more information,
75+
The Firebase C++ SDK supports the C++17 language standard. For more information,
7676
please see our [C++ Language Standard Support
7777
Criteria](https://opensource.google/documentation/policies/cplusplus-support#c_language_standard).
7878

@@ -677,6 +677,7 @@ code.
677677
## Release Notes
678678
### Upcoming Release
679679
- Changes
680+
- General: Updated the minimum C++ standard from C++14 to C++17.
680681
- iOS: Added an option to explicitly specify your app's `AppDelegate` class
681682
name via the `FirebaseAppDelegateClassName` key in `Info.plist`. This
682683
provides a more direct way for Firebase to interact with your specified

0 commit comments

Comments
 (0)