aboutsummaryrefslogtreecommitdiff
path: root/build_msvc
diff options
context:
space:
mode:
authorAaron Clauson <aaron@sipsorcery.com>2020-09-29 13:48:28 +0100
committerAaron Clauson <aaron@sipsorcery.com>2020-09-29 13:48:28 +0100
commit712f95d3324d02310dd468e7bfd1e1b0df432e77 (patch)
tree3300602820563f8c97bf87e9d2bf01ede25ce358 /build_msvc
parent1b313cacc99a1b372238f9036abed5491f9d28f7 (diff)
downloadbitcoin-712f95d3324d02310dd468e7bfd1e1b0df432e77.tar.xz
Update msvc build to use new vcpkg manifest
The vcpkg tool has introduced a proper way to use manifests, https://devblogs.microsoft.com/cppblog/vcpkg-accelerate-your-team-development-environment-with-binary-caching-and-manifests/. This PR replaces the custom text file mechanism with the new manifest approach. It is planned that vckpg manifests will include the ability to version dependencies in the future. Dependency versions would solve a number of issues that currently require workarounds with the appveyor CI. Set vcpkg manifest version to 1 to avoid any perception it's related to any release or other version numbering.
Diffstat (limited to 'build_msvc')
-rw-r--r--build_msvc/.gitignore1
-rw-r--r--build_msvc/README.md28
-rw-r--r--build_msvc/common.init.vcxproj9
-rw-r--r--build_msvc/vcpkg-packages.txt1
-rw-r--r--build_msvc/vcpkg.json19
5 files changed, 36 insertions, 22 deletions
diff --git a/build_msvc/.gitignore b/build_msvc/.gitignore
index 3e71c7b8d3..ae8120fdf3 100644
--- a/build_msvc/.gitignore
+++ b/build_msvc/.gitignore
@@ -24,3 +24,4 @@ libtest_util/libtest_util.vcxproj
*/Win32
libbitcoin_qt/QtGeneratedFiles/*
test_bitcoin-qt/QtGeneratedFiles/*
+vcpkg_installed \ No newline at end of file
diff --git a/build_msvc/README.md b/build_msvc/README.md
index a489fb36b2..87ea556a23 100644
--- a/build_msvc/README.md
+++ b/build_msvc/README.md
@@ -3,7 +3,7 @@ Building Bitcoin Core with Visual Studio
Introduction
---------------------
-Solution and project files to build the Bitcoin Core applications `msbuild` or Visual Studio can be found in the build_msvc directory. The build has been tested with Visual Studio 2017 and 2019.
+Solution and project files to build the Bitcoin Core applications `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2017 and 2019.
Building with Visual Studio is an alternative to the Linux based [cross-compiler build](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md).
@@ -12,10 +12,9 @@ Quick Start
The minimal steps required to build Bitcoin Core with the msbuild toolchain are below. More detailed instructions are contained in the following sections.
```
-vcpkg install --triplet x64-windows-static berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion
-vcpkg integrate install
-py -3 build_msvc\msvc-autogen.py
-msbuild /m build_msvc\bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build
+cd build_msvc
+py -3 msvc-autogen.py
+msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build
```
Dependencies
@@ -28,14 +27,7 @@ Options for installing the dependencies in a Visual Studio compatible manner are
- Download the source code, build each dependency, add the required include paths, link libraries and binary tools to the Visual Studio project files.
- Use [nuget](https://www.nuget.org/) packages with the understanding that any binary files have been compiled by an untrusted third party.
-The [external dependencies](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md) required for building are:
-
-- Berkeley DB
-- Boost
-- DoubleConversion
-- libevent
-- Qt5
-- ZeroMQ
+The [external dependencies](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md) required for building are listed in the `build_msvc/vcpkg.json` file. The `msbuild` project files are configured to automatically install the `vcpkg` dependencies.
Qt
---------------------
@@ -52,12 +44,6 @@ Building
The instructions below use `vcpkg` to install the dependencies.
- Install [`vcpkg`](https://github.com/Microsoft/vcpkg).
-- Install the required packages (replace x64 with x86 as required). The list of required packages can be found in the `build_msvc\vcpkg-packages.txt` file. The PowerShell command below will work if run from the repository root directory and `vcpkg` is in the path. Alternatively the contents of the packages text file can be pasted in place of the `Get-Content` cmdlet.
-
-```
-PS >.\vcpkg install --triplet x64-windows-static $(Get-Content -Path build_msvc\vcpkg-packages.txt).split()
-PS >.\vcpkg integrate install
-```
- Use Python to generate `*.vcxproj` from Makefile
@@ -65,7 +51,7 @@ PS >.\vcpkg integrate install
PS >py -3 msvc-autogen.py
```
-- An optional step is to adjust the settings in the build_msvc directory and the common.init.vcxproj file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set.
+- An optional step is to adjust the settings in the `build_msvc` directory and the `common.init.vcxproj` file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set.
- To build from the command line with the Visual Studio 2017 toolchain use:
@@ -79,7 +65,7 @@ msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /p:PlatformTools
msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build
```
-- Alternatively open the `build_msvc\bitcoin.sln` file in Visual Studio.
+- Alternatively open the `build_msvc/bitcoin.sln` file in Visual Studio.
AppVeyor
---------------------
diff --git a/build_msvc/common.init.vcxproj b/build_msvc/common.init.vcxproj
index a080fd2aa4..ed227519ae 100644
--- a/build_msvc/common.init.vcxproj
+++ b/build_msvc/common.init.vcxproj
@@ -9,6 +9,15 @@
<UseNativeEnvironment>true</UseNativeEnvironment>
</PropertyGroup>
+ <PropertyGroup Label="Vcpkg">
+ <VcpkgEnabled>true</VcpkgEnabled>
+ <VcpkgEnableManifest>true</VcpkgEnableManifest>
+ <VcpkgManifestInstall>true</VcpkgManifestInstall>
+ <VcpkgUseStatic>true</VcpkgUseStatic>
+ <VcpkgAutoLink>true</VcpkgAutoLink>
+ <VcpkgConfiguration>$(Configuration)</VcpkgConfiguration>
+ </PropertyGroup>
+
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and !Exists('$(WindowsSdkDir)\DesignTime\CommonConfiguration\Neutral\Windows.props')">
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
diff --git a/build_msvc/vcpkg-packages.txt b/build_msvc/vcpkg-packages.txt
deleted file mode 100644
index edce8576c3..0000000000
--- a/build_msvc/vcpkg-packages.txt
+++ /dev/null
@@ -1 +0,0 @@
-berkeleydb boost-filesystem boost-multi-index boost-process boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion
diff --git a/build_msvc/vcpkg.json b/build_msvc/vcpkg.json
new file mode 100644
index 0000000000..5d5f94227f
--- /dev/null
+++ b/build_msvc/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "bitcoin-core",
+ "version-string": "1",
+ "dependencies": [
+ "berkeleydb",
+ "boost-filesystem",
+ "boost-multi-index",
+ "boost-process",
+ "boost-signals2",
+ "boost-test",
+ "boost-thread",
+ "double-conversion",
+ {
+ "name": "libevent",
+ "features": ["thread"]
+ },
+ "zeromq"
+ ]
+} \ No newline at end of file