|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Shelley Vohr < [email protected]> |
| 3 | +Date: Wed, 4 Sep 2024 16:39:23 +0200 |
| 4 | +Subject: build: compile with C++20 support |
| 5 | + |
| 6 | +Refs https://github.com/nodejs/node/pull/45427 |
| 7 | + |
| 8 | +V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8/+/5587859. |
| 9 | + |
| 10 | +This can be removed when Electron upgrades to a version of Node.js containing the required V8 version. |
| 11 | + |
| 12 | +diff --git a/common.gypi b/common.gypi |
| 13 | +index 8736ad12eec294070a5160a64248044cd16347c9..216200c279c599f6dee228120ff5f3943fa52ffd 100644 |
| 14 | +--- a/common.gypi |
| 15 | ++++ b/common.gypi |
| 16 | +@@ -307,7 +307,7 @@ |
| 17 | + 'VCCLCompilerTool': { |
| 18 | + 'AdditionalOptions': [ |
| 19 | + '/Zc:__cplusplus', |
| 20 | +- '-std:c++17' |
| 21 | ++ '-std:c++20' |
| 22 | + ], |
| 23 | + 'BufferSecurityCheck': 'true', |
| 24 | + 'DebugInformationFormat': 1, # /Z7 embed info in .obj files |
| 25 | +@@ -489,7 +489,7 @@ |
| 26 | + }], |
| 27 | + [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { |
| 28 | + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], |
| 29 | +- 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ], |
| 30 | ++ 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++20' ], |
| 31 | + 'defines': [ '__STDC_FORMAT_MACROS' ], |
| 32 | + 'ldflags': [ '-rdynamic' ], |
| 33 | + 'target_conditions': [ |
| 34 | +@@ -660,7 +660,7 @@ |
| 35 | + ['clang==1', { |
| 36 | + 'xcode_settings': { |
| 37 | + 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', |
| 38 | +- 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++17', # -std=gnu++17 |
| 39 | ++ 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++20', # -std=gnu++20 |
| 40 | + 'CLANG_CXX_LIBRARY': 'libc++', |
| 41 | + }, |
| 42 | + }], |
0 commit comments