0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

build: Increase MS Visual Studio minimum version

Visual Studio 2022 with `/std:c++20` supports designated initializers.
This commit is contained in:
Hennadii Stepanov 2022-07-01 01:22:22 +02:00
parent 555f9dd5d3
commit 88ec5d40dc
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
4 changed files with 8 additions and 6 deletions

View file

@ -3,7 +3,9 @@ Building Bitcoin Core with Visual Studio
Introduction
---------------------
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).
Visual Studio 2022 is minimum required to build Bitcoin Core.
Solution and project files to build with `msbuild` or Visual Studio can be found in the `build_msvc` directory.
To build Bitcoin Core from the command-line, it is sufficient to only install the Visual Studio Build Tools component.

View file

@ -50,8 +50,8 @@
/* Define this symbol if the consensus lib has been built */
#define HAVE_CONSENSUS_LIB 1
/* define if the compiler supports basic C++17 syntax */
#define HAVE_CXX17 1
/* define if the compiler supports basic C++20 syntax */
#define HAVE_CXX20 1
/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
don't. */

View file

@ -87,10 +87,10 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalOptions>/utf-8 /Zc:__cplusplus /std:c++17 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/utf-8 /Zc:__cplusplus /std:c++20 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4018;4244;4267;4334;4715;4805;4834</DisableSpecificWarnings>
<TreatWarningAsError>true</TreatWarningAsError>
<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>
<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>
<AdditionalIncludeDirectories>..\..\src;..\..\src\minisketch\include;..\..\src\univalue\include;..\..\src\secp256k1\include;..\..\src\leveldb\include;..\..\src\leveldb\helpers\memenv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View file

@ -93,7 +93,7 @@ def set_properties(vcxproj_filename, placeholder, content):
def main():
parser = argparse.ArgumentParser(description='Bitcoin-core msbuild configuration initialiser.')
parser.add_argument('-toolset', nargs='?', default=DEFAULT_PLATFORM_TOOLSET,
help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019, or v143 for Visual Studio 2022.'
help='Optionally sets the msbuild platform toolset, e.g. v143 for Visual Studio 2022.'
' default is %s.'%DEFAULT_PLATFORM_TOOLSET)
args = parser.parse_args()
set_properties(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), '@TOOLSET@', args.toolset)