You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #15529: Add Qt programs to msvc build (updated, no code changes)
1619684 Added libbitcoin_qt and bitcoin-qt to the msbuild configuration. (Aaron Clauson)
Pull request description:
This PR has ~~90%~~ all of the work done to allow the bitcoin Qt programs to be built with msvc and the appveyor script.
Outstanding issues:
- ~~There are ~~3~~ ~~6~~ 5 code tweaks required for the bitcoin Qt components to be built without warnings with msvc. They seem minor~~,
- Building Qt as a static library for Windows is painful and time consuming. I doubt it will ever be possible to build Qt from source as part of an appveyor job (and it would probably take over an hour even if it was). My tentative solution is to build locally and upload the binaries as a [github release](https://github.com/sipsorcery/qt_win_binary/releases). The msvc build is only for testing and tinkering but even so this doesn't feel like the ideal solution. Open to suggestions?
- ~~There is still an issue to sort out with the payment request URL handling. Building Qt with openssl is an extra headache. I will continue to work on getting this working.~~
The big benefit of this PR is the ability to run bitcoin-qt within a Visual Studio debugging session which could expedite tracking down issues on Windows.
On a side note the test-bitcoin-qt tests fail very early, probably due to *nix specific tests. I haven't dug into them at this point.
**Update 28 Jun 2019**: The ENABLE_BIP70 option is now off (it's flagged for removal as per #15584). With it disabled msbuild does not require any code changes to build the Bitcoin Core Qt applications.
ACKs for top commit:
fanquake:
re-ACK 1619684 - AppVeyor looks ok now.
Tree-SHA512: c0d3fd53b3ff99096b2505d519ed5ca6791bc4bce77addf9c520dc042eec5980a51a1fb9f0aa72e9cc53773085c43218793ca7a915a47806a3a1ffb84d9409f9
Copy file name to clipboardExpand all lines: build_msvc/README.md
+55-10Lines changed: 55 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,32 +3,54 @@ Building Bitcoin Core with Visual Studio
3
3
4
4
Introduction
5
5
---------------------
6
-
Solution and project files to build the Bitcoin Core applications (except Qt dependent ones) with Visual Studio 2017 can be found in the build_msvc directory.
6
+
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.
7
7
8
8
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).
9
9
10
+
Quick Start
11
+
---------------------
12
+
The minimal steps required to build Bitcoin Core with the msbuild toolchain are below. More detailed instructions are contained in the following sections.
A number of [open source libraries](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md) are required in order to be able to build Bitcoin.
22
+
A number of [open source libraries](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md) are required in order to be able to build Bitcoin Core.
13
23
14
24
Options for installing the dependencies in a Visual Studio compatible manner are:
15
25
16
26
- Use Microsoft's [vcpkg](https://docs.microsoft.com/en-us/cpp/vcpkg) to download the source packages and build locally. This is the recommended approach.
17
27
- Download the source code, build each dependency, add the required include paths, link libraries and binary tools to the Visual Studio project files.
18
28
- Use [nuget](https://www.nuget.org/) packages with the understanding that any binary files have been compiled by an untrusted third party.
19
29
20
-
The external dependencies required for the Visual Studio build are (see [dependencies.md](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md) for more info):
30
+
The [external dependencies](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md)required for building are:
21
31
22
32
- Berkeley DB
23
-
- OpenSSL
24
33
- Boost
34
+
- DoubleConversion
25
35
- libevent
26
-
- ZeroMQ
36
+
- OpenSSL
37
+
- Qt5
27
38
- RapidCheck
39
+
- ZeroMQ
40
+
41
+
Qt
42
+
---------------------
43
+
All the Bitcoin Core applications are configured to build with static linking. In order to build the Bitcoin Core Qt applications a static build of Qt is required.
44
+
45
+
The runtime library version (e.g. v141, v142) and platform type (x86 or x64) must also match. OpenSSL must also be linked into the Qt binaries in order to provide full functionality of the Bitcoin Core Qt programs. An example of the configure command to build Qtv5.9.7 locally to link with Bitcoin Core is shown below (adjust paths accordingly), note it can be expected that the configure and subsequent build will fail numerous times until dependency issues are resolved.
A prebuilt version for x64 and Visual C++ runtime v141 (Visual Studio 2017) can be downloaded from [here](https://github.com/sipsorcery/qt_win_binary/releases). Please be aware this download is NOT an officially sanctioned Bitcoin Core distribution and is provided for developer convenience. It should NOT be used for builds that will be used in a production environment or with real funds.
28
52
29
-
Additional dependencies required from the [bitcoin-core](https://github.com/bitcoin-core) GitHub repository are:
30
-
- libsecp256k1
31
-
- LevelDB
53
+
To build Bitcoin Core without Qt unload or disable the bitcoin-qt, libbitcoin_qt and test_bitcoin-qt projects.
32
54
33
55
Building
34
56
---------------------
@@ -38,7 +60,7 @@ The instructions below use `vcpkg` to install the dependencies.
38
60
- Install the required packages (replace x64 with x86 as required):
@@ -47,4 +69,27 @@ The instructions below use `vcpkg` to install the dependencies.
47
69
PS >py -3 msvc-autogen.py
48
70
```
49
71
50
-
- Build in Visual Studio.
72
+
- 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.
The .appveyor.yml in the root directory is suitable to perform builds on [AppVeyor](https://www.appveyor.com/) Continuous Integration servers. The simplest way to perform an AppVeyor build is to fork Bitcoin Core and then configure a new AppVeyor Project pointing to the forked repository.
89
+
90
+
For safety reasons the Bitcoin Core .appveyor.yml file has the artifact options disabled. The build will be performed but no executable files will be available. To enable artifacts on a forked repository uncomment the lines shown below:
91
+
92
+
```
93
+
#- 7z a bitcoin-%APPVEYOR_BUILD_VERSION%.zip %APPVEYOR_BUILD_FOLDER%\build_msvc\%platform%\%configuration%\*.exe
0 commit comments