Skip to content

Commit 7f5a572

Browse files
jonsimantovwu-hui
andauthored
Update to C++14. (#1250)
* Update CXX_STANDARD to 14. * Add CMAKE_CXX_STANDARD_REQUIRED setting. * Update C++ version in testapps. * Upgrade to grpc 150 and C++ 14 for firestore (#1182) * Upgrade to grpc 150 and C++ 14 for firestore * Add firestore_dep_source to workflow * Use C++14 make_unique * Ensure CXX14 * Formatting * CXX required in test * C++14 for xcode project * Ensures lineendings on windows so we can apply patch files * Fix build error * Add readme note about c++14. * Remove C++ version warning header. --------- Co-authored-by: wu-hui <[email protected]>
1 parent 4318a1d commit 7f5a572

File tree

52 files changed

+90
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+90
-141
lines changed

.github/workflows/integration_tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ on:
3939
description: 'Optional: Packaging run # to build against?'
4040
test_pull_request:
4141
description: 'Optional: Pull request # to build and test? (With optional commit hash, separated by a colon. Specify the FULL hash.)'
42+
firestore_dep_source:
43+
description: 'Optional: Where to get firestore iOS SDK from: "RELEASED", "TIP" or "<git-commit> from firestore-ios-sdk"'
4244

4345
env:
4446
triggerLabelPrefix: "tests-requested: "
@@ -330,6 +332,8 @@ jobs:
330332
if [[ "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
331333
# at 3am PST/4am PDT. Running firestore desktop integration test aginst tip-of-tree ios repo
332334
additional_flags+=(--cmake_flag=-DFIRESTORE_DEP_SOURCE=TIP)
335+
elif [[ "${{ github.event.inputs.firestore_dep_source }}" ]]; then
336+
additional_flags+=(--cmake_flag=-DFIRESTORE_DEP_SOURCE=${{ github.event.inputs.firestore_dep_source }})
333337
fi
334338
python scripts/gha/build_testapps.py --p Desktop \
335339
--t ${{ needs.check_and_prepare.outputs.apis }} \

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
cmake_minimum_required (VERSION 3.1)
1818

19-
set (CMAKE_CXX_STANDARD 11)
19+
set (CMAKE_CXX_STANDARD 14)
20+
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.
2021

2122
# Turn on virtual folders for visual studio
2223
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

admob/integration_test/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
8484
# The include directory for the testapp.
8585
include_directories(src)
8686

87-
# Integration test uses some features that require C++ 11, such as lambdas.
88-
set (CMAKE_CXX_STANDARD 11)
87+
# Firebase C++ SDK requires C++14.
88+
set (CMAKE_CXX_STANDARD 14)
89+
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.
8990

9091
# Download and unpack googletest (and googlemock) at configure time
9192
set(GOOGLETEST_ROOT ${CMAKE_CURRENT_LIST_DIR}/external/googletest)

admob/src/include/firebase/admob.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "firebase/admob/rewarded_video.h"
2929
#include "firebase/admob/types.h"
3030
#include "firebase/app.h"
31-
#include "firebase/cpp_version_warning.h"
3231
#include "firebase/internal/common.h"
3332

3433
#if !defined(DOXYGEN) && !defined(SWIG)

analytics/integration_test/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
8484
# The include directory for the testapp.
8585
include_directories(src)
8686

87-
# Integration test uses some features that require C++ 11, such as lambdas.
88-
set (CMAKE_CXX_STANDARD 11)
87+
# Firebase C++ SDK requires C++14.
88+
set (CMAKE_CXX_STANDARD 14)
89+
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.
8990

9091
# Download and unpack googletest (and googlemock) at configure time
9192
set(GOOGLETEST_ROOT ${CMAKE_CURRENT_LIST_DIR}/external/googletest)

analytics/src/include/firebase/analytics.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <string>
2424

2525
#include "firebase/app.h"
26-
#include "firebase/cpp_version_warning.h"
2726
#include "firebase/future.h"
2827
#include "firebase/internal/common.h"
2928
#include "firebase/variant.h"

app/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ endif()
251251

252252
set(internal_HDRS
253253
src/include/firebase/app.h
254-
src/include/firebase/cpp_version_warning.h
255254
src/include/firebase/future.h
256255
src/include/firebase/internal/common.h
257256
src/include/firebase/internal/future_impl.h

app/integration_test/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
8484
# The include directory for the testapp.
8585
include_directories(src)
8686

87-
# Integration test uses some features that require C++ 11, such as lambdas.
88-
set (CMAKE_CXX_STANDARD 11)
87+
# Firebase C++ SDK requires C++14.
88+
set (CMAKE_CXX_STANDARD 14)
89+
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.
8990

9091
# Download and unpack googletest (and googlemock) at configure time
9192
set(GOOGLETEST_ROOT ${CMAKE_CURRENT_LIST_DIR}/external/googletest)

app/rest/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
# CMake file for the firebase_rest_lib library
1616

1717
cmake_minimum_required (VERSION 3.1)
18-
set (CMAKE_CXX_STANDARD 11)
18+
# Firebase C++ SDK requires C++14.
19+
set (CMAKE_CXX_STANDARD 14)
20+
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.
1921

2022
project(firebase_rest_lib NONE)
2123
enable_language(C)

app/src/include/firebase/app.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifndef FIREBASE_APP_SRC_INCLUDE_FIREBASE_APP_H_
1818
#define FIREBASE_APP_SRC_INCLUDE_FIREBASE_APP_H_
1919

20-
#include "cpp_version_warning.h"
2120
#include "firebase/internal/platform.h"
2221

2322
#if FIREBASE_PLATFORM_ANDROID

0 commit comments

Comments
 (0)