From 49444a529bd52c307d574f82b23a35e17e1a0f17 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 8 Jul 2020 18:18:35 +0400 Subject: [PATCH] Force using of std::optional. --- webrtc_build.diff | 17 +++++++++++++---- webrtc_third_party.diff | 13 +++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/webrtc_build.diff b/webrtc_build.diff index f483060..adda665 100644 --- a/webrtc_build.diff +++ b/webrtc_build.diff @@ -12,7 +12,7 @@ index 5ced4596f..db1b27cb2 100644 (is_linux && (!is_chromeos || default_toolchain != "//build/toolchain/cros:target")) diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn -index 3d5e4dede..bd6a7ddc4 100644 +index 3d5e4dede..17b3bcfd0 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -535,7 +535,7 @@ config("compiler") { @@ -24,7 +24,16 @@ index 3d5e4dede..bd6a7ddc4 100644 } } else if (!is_win && !is_nacl) { if (target_os == "android") { -@@ -1379,6 +1379,8 @@ config("default_warnings") { +@@ -554,6 +554,8 @@ config("compiler") { + } else { + cflags_cc += [ "-std=c++14" ] + } ++ } else if (is_win) { ++ cflags_cc += [ "/std:c++17" ] + } + + if (is_mac) { +@@ -1379,6 +1381,8 @@ config("default_warnings") { "/wd4715", # 'function' : not all control paths return a value' # MSVC does not analyze switch (enum) for completeness. @@ -33,7 +42,7 @@ index 3d5e4dede..bd6a7ddc4 100644 ] cflags_cc += [ -@@ -1488,7 +1490,7 @@ config("default_warnings") { +@@ -1488,7 +1492,7 @@ config("default_warnings") { cflags += [ "-Wno-nonportable-include-path" ] } @@ -42,7 +51,7 @@ index 3d5e4dede..bd6a7ddc4 100644 # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not # recognize. cflags += [ -@@ -1528,6 +1530,24 @@ config("default_warnings") { +@@ -1528,6 +1532,24 @@ config("default_warnings") { ] } } diff --git a/webrtc_third_party.diff b/webrtc_third_party.diff index 617ec75..537c086 100644 --- a/webrtc_third_party.diff +++ b/webrtc_third_party.diff @@ -12,6 +12,19 @@ index a62632e2c3f..ea2a9325a9c 100644 } config("libjpeg_turbo_config") { +diff --git a/abseil-cpp/absl/types/optional.h b/abseil-cpp/absl/types/optional.h +index 61540cfdb26..3249d1b90d3 100644 +--- a/abseil-cpp/absl/types/optional.h ++++ b/abseil-cpp/absl/types/optional.h +@@ -54,6 +54,8 @@ ABSL_NAMESPACE_END + + #else // ABSL_USES_STD_OPTIONAL + ++#error "Build with non-std optional is not supported." ++ + #include + #include + #include diff --git a/libjpeg.gni b/libjpeg.gni index 049348b79bd..039385c9739 100644 --- a/libjpeg.gni