Skip to content

Commit 88ec5d4

Browse files
committed
build: Increase MS Visual Studio minimum version
Visual Studio 2022 with `/std:c++20` supports designated initializers.
1 parent 555f9dd commit 88ec5d4

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

build_msvc/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Building Bitcoin Core with Visual Studio
33

44
Introduction
55
---------------------
6-
Solution and project files to build Bitcoin Core with `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2022 and Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work).
6+
Visual Studio 2022 is minimum required to build Bitcoin Core.
7+
8+
Solution and project files to build with `msbuild` or Visual Studio can be found in the `build_msvc` directory.
79

810
To build Bitcoin Core from the command-line, it is sufficient to only install the Visual Studio Build Tools component.
911

build_msvc/bitcoin_config.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
/* Define this symbol if the consensus lib has been built */
5151
#define HAVE_CONSENSUS_LIB 1
5252

53-
/* define if the compiler supports basic C++17 syntax */
54-
#define HAVE_CXX17 1
53+
/* define if the compiler supports basic C++20 syntax */
54+
#define HAVE_CXX20 1
5555

5656
/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
5757
don't. */

build_msvc/common.init.vcxproj.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@
8787
<ClCompile>
8888
<WarningLevel>Level3</WarningLevel>
8989
<PrecompiledHeader>NotUsing</PrecompiledHeader>
90-
<AdditionalOptions>/utf-8 /Zc:__cplusplus /std:c++17 %(AdditionalOptions)</AdditionalOptions>
90+
<AdditionalOptions>/utf-8 /Zc:__cplusplus /std:c++20 %(AdditionalOptions)</AdditionalOptions>
9191
<DisableSpecificWarnings>4018;4244;4267;4334;4715;4805;4834</DisableSpecificWarnings>
9292
<TreatWarningAsError>true</TreatWarningAsError>
93-
<PreprocessorDefinitions>DISABLE_DESIGNATED_INITIALIZER_ERRORS;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING;ZMQ_STATIC;NOMINMAX;WIN32;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
93+
<PreprocessorDefinitions>_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING;ZMQ_STATIC;NOMINMAX;WIN32;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9494
<AdditionalIncludeDirectories>..\..\src;..\..\src\minisketch\include;..\..\src\univalue\include;..\..\src\secp256k1\include;..\..\src\leveldb\include;..\..\src\leveldb\helpers\memenv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
9595
</ClCompile>
9696
<Link>

build_msvc/msvc-autogen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def set_properties(vcxproj_filename, placeholder, content):
9393
def main():
9494
parser = argparse.ArgumentParser(description='Bitcoin-core msbuild configuration initialiser.')
9595
parser.add_argument('-toolset', nargs='?', default=DEFAULT_PLATFORM_TOOLSET,
96-
help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019, or v143 for Visual Studio 2022.'
96+
help='Optionally sets the msbuild platform toolset, e.g. v143 for Visual Studio 2022.'
9797
' default is %s.'%DEFAULT_PLATFORM_TOOLSET)
9898
args = parser.parse_args()
9999
set_properties(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), '@TOOLSET@', args.toolset)

0 commit comments

Comments
 (0)