Skip to content

Latest commit

 

History

History
87 lines (76 loc) · 3.08 KB

WINDOWS.md

File metadata and controls

87 lines (76 loc) · 3.08 KB

To build NZBGet you will need:

  • CMake
  • MS C++ Build tools
    • Download Build Tools for Visual Studio 2022 and install it
    • Select Desktop development with C++ in the Desktop & Mobile section and install the necessary components:
      • MSVC v143 - VS 2022 C++ x64/x86 build tools

      • Windows 11 SDK

      • C++ ATL for latest v143 build tools

      • C++ MFC for latest v143 build tools

      • Edit the Path enviroment variable and append the folder's path that contains the MSBuild.exe to it, e.g.:

        C:\Users\asus\AppData\Local\Programs\Microsoft VS Code\bin\

To compile the program with TLS/SSL support you need OpenSSL:

Also required are:

For tests:

We recommend using vcpkg to install dependencies:

  • Clone the repository to the recommended C:\ disk:
git clone --depth 1 https://github.com/microsoft/vcpkg.git
  • Run the bootstrap script:
.\vcpkg\bootstrap-vcpkg.bat
  • Edit the Path enviroment variable and append the folder's path: C:\vcpkg
  • Install all the dependencies:
vcpkg install openssl:x64-windows-static
vcpkg install libxml2:x64-windows-static
vcpkg install zlib:x64-windows-static
vcpkg install boost-json:x64-windows-static
vcpkg install boost-optional:x64-windows-static
  • For tests:
vcpkg install boost-test:x64-windows-static

For Win32, instead of :x64-windows-static, use :x86-windows-static.

  • Configure:
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -A x64
  • Or for Win32:
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -A Win32
  • Release build:
cmake --build . --config Release
  • Or for debug build:
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug 
  • Debug build:
cmake --build . --config Debug
  • Now, you can find the binary in the Release/Debug directory.

You may run configure with additional arguments:

  • Enable tests:
cmake .. -DENABLE_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
  • Disable TLS. Use this option if you can not use OpenSSL but some features of nzbget will stop working, such as Extension Manager:
cmake .. -DDISABLE_TLS=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static