├── LICENSE.header ├── helpers └── vcpkg │ └── ports │ └── zeroc-ice │ ├── CONTROL │ └── portfile.cmake ├── .gitignore ├── CONTRIBUTORS ├── AUTHORS ├── LICENSE ├── Get-MumbleDeps.ps1 ├── get-mumble_deps.sh └── README.md /LICENSE.header: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The 'mumble-releng-experimental' Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that 3 | // can be found in the LICENSE file in the source tree or at 4 | // . 5 | -------------------------------------------------------------------------------- /helpers/vcpkg/ports/zeroc-ice/CONTROL: -------------------------------------------------------------------------------- 1 | Source: zeroc-ice 2 | Version: 3.7.3 3 | Homepage: https://github.com/zeroc-ice/ice 4 | Description: Comprehensive RPC framework with support for C++, CSharp, Java, JavaScript, Python and more. 5 | Build-Depends: bzip2 (!uwp), expat (!uwp), mcpp, lmdb (!uwp), openssl (!uwp), zlib (!uwp) 6 | 7 | Feature: cpp11 8 | Description: build C++11 libraries 9 | Build-Depends: bzip2, expat, mcpp, openssl, mcpp, zlib 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /win-x64/.vs/win-x64/v15 6 | /win-x64/.vs/VSWorkspaceState.json 7 | /win-x64/.vs/slnx.sqlite 8 | /win-x64/.vs/ProjectSettings.json 9 | /.vs/ProjectSettings.json 10 | /.vs/slnx.sqlite 11 | /.vs/mumble-releng-experimental/v15/.suo 12 | /.vs/VSWorkspaceState.json 13 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | // This is the official list of people who have contributed 2 | // code to 'mumble-releng-experimental'. 3 | // 4 | // This is distinct from the AUTHORS file in order to keep 5 | // track of each individual contributor in the case where a 6 | // contribution is under company copyright. 7 | // 8 | // The use of the 'mumble-releng-experimental' source code is governed by a 9 | // BSD-style license that can be found in the LICENSE file in 10 | // the source tree or at 11 | // . 12 | // 13 | // A list of The 'mumble-releng' Authors can be found 14 | // in the AUTHORS file in the source tree or at 15 | // . 16 | 17 | // Honorable Mentions 18 | 19 | Jan Klass 20 | Justin Wood 21 | Michał Żukowski 22 | Mikkel Krautz 23 | Stefan Hacker 24 | 25 | // Contributors 26 | Nik Reist 27 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | // This file lists The 'mumble-releng-experimental' Authors, the people 2 | // and/or companies that hold the copyright to 'mumble-releng-experimental'. 3 | // 4 | // The use of the 'mumble-releng-experimental' source code is governed by a 5 | // BSD-style license that can be found in the LICENSE file in 6 | // the source tree or at 7 | // . 8 | // 9 | // A list of all contributors can be found in the CONTRIBUTORS 10 | // file in the source tree or at 11 | // . 12 | // 13 | // Names should be added to this file as 14 | // Name or Organization 15 | // The email address is not required for organizations. 16 | 17 | // Honorable Mentions 18 | 19 | Jan Klass 20 | Justin Wood 21 | Michał Żukowski 22 | Mikkel Krautz 23 | Stefan Hacker 24 | 25 | // Authors 26 | Nik Reist 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2014 The 'mumble-releng' Authors 2 | 3 | A list of The 'mumble-releng' Authors can be found 4 | in the AUTHORS file in the source tree or at 5 | . 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | - Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimer. 15 | - Redistributions in binary form must reproduce the above copyright notice, 16 | this list of conditions and the following disclaimer in the documentation 17 | and/or other materials provided with the distribution. 18 | - Neither the name of The 'mumble-releng' Authors nor the names of its 19 | contributors may be used to endorse or promote products derived from this 20 | software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /helpers/vcpkg/ports/zeroc-ice/portfile.cmake: -------------------------------------------------------------------------------- 1 | vcpkg_from_github( 2 | OUT_SOURCE_PATH SOURCE_PATH 3 | REPO mumble-voip/ice 4 | REF 3.7 5 | SHA512 12cebb53ad1a9271e7db8c12df5f2db9f8cbaec97b562596c4c592bd2449177b6927156100166b432b7e27b13f0d202155748691fd1e848eb6db815f16bcc57f 6 | ) 7 | 8 | if("cpp11" IN_LIST FEATURES) 9 | vcpkg_configure_cmake( 10 | SOURCE_PATH ${SOURCE_PATH} 11 | PREFER_NINJA 12 | OPTIONS 13 | -DBUILD_ICE_CXX=ON 14 | -DBUILD_ICE_CPP11=ON 15 | ) 16 | else() 17 | vcpkg_configure_cmake( 18 | SOURCE_PATH ${SOURCE_PATH} 19 | PREFER_NINJA 20 | OPTIONS 21 | -DBUILD_ICE_CXX=ON 22 | ) 23 | endif() 24 | 25 | vcpkg_install_cmake() 26 | 27 | vcpkg_copy_pdbs() 28 | 29 | file(INSTALL ${SOURCE_PATH}/cpp/include DESTINATION ${CURRENT_PACKAGES_DIR}) 30 | file(INSTALL ${SOURCE_PATH}/slice DESTINATION ${CURRENT_PACKAGES_DIR}) 31 | file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/include 32 | DESTINATION ${CURRENT_PACKAGES_DIR} 33 | ) 34 | 35 | if(EXISTS ${CURRENT_PACKAGES_DIR}/bin) 36 | file(INSTALL ${CURRENT_PACKAGES_DIR}/bin/ DESTINATION ${CURRENT_PACKAGES_DIR}/tools/Ice) 37 | endif() 38 | 39 | file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/icebuilder/bin/ DESTINATION ${CURRENT_PACKAGES_DIR}/tools/Ice) 40 | 41 | vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/Ice) 42 | 43 | if(UNIX) 44 | vcpkg_execute_required_process(COMMAND chmod -R +x Ice 45 | WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools 46 | LOGNAME ice-${TARGET_TRIPLET}-setexe 47 | ) 48 | endif() 49 | 50 | file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) 51 | 52 | file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) 53 | 54 | file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 55 | file(INSTALL ${SOURCE_PATH}/ICE_LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) 56 | -------------------------------------------------------------------------------- /Get-MumbleDeps.ps1: -------------------------------------------------------------------------------- 1 | $profiledir = $Env:USERPROFILE 2 | $vcpkgdir = $profiledir + "\vcpkg" 3 | 4 | $mumble_deps = "qt5-base", 5 | "qt5-svg", 6 | "qt5-tools", 7 | "grpc", 8 | "boost-accumulators", 9 | "opus", 10 | "poco", 11 | "libvorbis", 12 | "libogg", 13 | "libflac", 14 | "libsndfile", 15 | "libmariadb", 16 | "zlib", 17 | "zeroc-ice" 18 | 19 | $ErrorActionPreference = 'Stop' 20 | 21 | function vcpkg_install { 22 | Param( 23 | [string] $package, 24 | [string] $targetTriplet, 25 | [switch] $cleanAfterBuild = $false 26 | ) 27 | 28 | if ($cleanAfterBuild) { 29 | ./vcpkg.exe install "$package" --triplet "$targetTriplet" --clean-after-build 30 | } else { 31 | ./vcpkg.exe install "$package" --triplet "$targetTriplet" 32 | } 33 | 34 | if (-not $?) { 35 | Write-Error("Failed at installing package $package ($targetTriplet)") 36 | } 37 | } 38 | 39 | $prevDir=pwd 40 | 41 | try { 42 | Write-Host "Setting triplets for $Env:PROCESSOR_ARCHITECTURE" 43 | if ($Env:PROCESSOR_ARCHITECTURE -eq "AMD64") { 44 | $triplet = "x64-windows-static-md" 45 | $xcompile_triplet = "x86-windows-static-md" 46 | } else { 47 | $triplet = "x86-windows-static-md" 48 | } 49 | 50 | Write-Host "Checking for $vcpkgdir..." 51 | if (-not (Test-Path $vcpkgdir)) { 52 | git clone https://github.com/Microsoft/vcpkg.git $vcpkgdir 53 | } 54 | 55 | if (Test-Path $vcpkgdir) { 56 | if (-not (Test-Path $vcpkgdir/ports/zeroc-ice)) { 57 | Write-Host "Adding ports for ZeroC Ice..." 58 | Copy-Item -Path ./helpers/vcpkg/ports/zeroc-ice -Destination $vcpkgdir/ports -Recurse 59 | } 60 | 61 | cd $vcpkgdir 62 | 63 | if (-not (Test-Path -LiteralPath $vcpkgdir/vcpkg.exe)) { 64 | Write-Host "Installing vcpkg..." 65 | ./bootstrap-vcpkg.bat -disableMetrics 66 | } 67 | 68 | vcpkg_install -package mdnsresponder -targetTriplet $triplet 69 | vcpkg_install -package icu -targetTriplet $triplet 70 | 71 | if ($Env:PROCESSOR_ARCHITECTURE -eq "AMD64") { 72 | Write-Host "Installing cross compile packages..." 73 | vcpkg_install -package boost-optional:$xcompile_triplet -targetTriplet $xcompile_triplet -cleanAfterBuild 74 | } 75 | 76 | Write-Host "Beginning package install..." 77 | 78 | foreach ($dep in $mumble_deps) { 79 | Write-Host("---------------------------------------") 80 | Write-Host("> Installing Mumble dependency $dep ...") 81 | Write-Host("---------------------------------------") 82 | 83 | vcpkg_install -package $dep -targetTriplet $triplet -cleanAfterBuild 84 | } 85 | } 86 | } catch { 87 | # rethrow 88 | throw $_ 89 | } finally { 90 | # restore previous directory 91 | cd $prevDir 92 | } 93 | -------------------------------------------------------------------------------- /get-mumble_deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2020 The 'mumble-releng-experimental' Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that 5 | # can be found in the LICENSE file in the source tree or at 6 | # . 7 | 8 | # Helper function to check if a certain parameter has been passed to the script 9 | has_option() { 10 | local desiredOption="$1" 11 | shift 12 | for currentOption in "$@"; do 13 | if [[ $currentOption == "$desiredOption" ]]; then 14 | return 0 15 | fi 16 | done 17 | return 1 18 | } 19 | 20 | if ! has_option '--auto' "$@" 21 | then 22 | # Make sure the command-prompt stays open if an error is encountered so that the user can read 23 | # the error message before the console closes. 24 | # If you run call this script as part of some automation, you'll want to pass --auto 25 | # to make sure you don't get stuck. 26 | trap "printf '\n\n'; read -p 'ERROR encountered... Press Enter to exit'" ERR 27 | fi 28 | 29 | # On failed command (error code) exit the whole script 30 | set -e 31 | # Treat using unset variables as errors 32 | set -u 33 | # For piped commands on command failure fail entire pipe instead of only the last command being significant 34 | set -o pipefail 35 | 36 | VCPKGDIR=~/vcpkg 37 | 38 | mumble_deps='qt5-base, 39 | qt5-svg, 40 | qt5-tools, 41 | grpc, 42 | boost-accumulators, 43 | opus, 44 | poco, 45 | libvorbis, 46 | libogg, 47 | libflac, 48 | libsndfile, 49 | libmariadb, 50 | zlib, 51 | zeroc-ice' 52 | 53 | # Determine vcpkg triplet from OS https://github.com/Microsoft/vcpkg/blob/master/docs/users/triplets.md 54 | # Available triplets can be printed with `vcpkg help triplet` 55 | case "$OSTYPE" in 56 | msys* ) triplet='x64-windows-static-md' 57 | xcompile_triplet='x86-windows-static-md' 58 | ;; 59 | linux-gnu* ) triplet='x64-linux';; 60 | darwin* ) triplet='x64-osx';; 61 | * ) echo "The OSTYPE is either not defined or unsupported. Aborting...";; 62 | esac 63 | 64 | if [ ! -d "$VCPKGDIR" ] 65 | then 66 | git clone https://github.com/Microsoft/vcpkg.git $VCPKGDIR 67 | fi 68 | 69 | if [ -d "$VCPKGDIR" ] 70 | then 71 | # copy ZeroC Ice port files 72 | cp -R helpers/vcpkg/ports/zeroc-ice $VCPKGDIR/ports 73 | cd $VCPKGDIR 74 | 75 | if [ ! -x $VCPKGDIR/vcpkg ] 76 | then 77 | case "$OSTYPE" in 78 | msys* ) ./bootstrap-vcpkg.bat -disableMetrics 79 | ;; 80 | * ) bash bootstrap-vcpkg.sh -disableMetrics 81 | ;; 82 | esac 83 | fi 84 | 85 | if [ -z "$triplet" ] 86 | then 87 | echo "Triplet type is not defined! Aborting..." 88 | else 89 | if [ $OSTYPE == msys ] 90 | then 91 | # install dns-sd provider 92 | ./vcpkg install mdnsresponder icu --triplet $triplet 93 | ./vcpkg install boost-optional:$xcompile_triplet --clean-after-build 94 | fi 95 | for dep in ${mumble_deps//,/ } 96 | do 97 | ./vcpkg install $dep:$triplet --clean-after-build 98 | done 99 | fi 100 | else 101 | echo "Failed to retrieve the 'vcpkg' repository! Aborting..." 102 | fi 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Important 2 | 3 | The build documentation (and all needed scripts & port files) is now located directly in the main repository. See https://github.com/mumble-voip/mumble/tree/master/docs/dev/build-instructions. 4 | 5 | Therefore this repo is now considered **deprecated**! 6 | 7 | # mumble-releng-vcpkg 8 | 9 | The goal of this project is to prepare a compilation environment for Mumble. 10 | 11 | Some dependencies are required for this tool to work. The dependencies are delivered using `vcpkg` for Windows, MacOS, and Linux and the source and its requirements are found [here](https://github.com/Microsoft/vcpkg). 12 | 13 | The Mumble project dependencies (libraries being used) will for the most part be prepared (downloaded and compiled) by this tool. 14 | 15 | We intend to provide workflows for setting up partial environments, for example to only compile the Mumble server software without the client, or with specific functionality not included. 16 | 17 | ## Build environment setup 18 | 19 | After the dependencies have been prepared with vcpkg and CMake you can build the Mumble project with them. 20 | 21 | The setup is slightly different between Windows and Linux-based systems. 22 | 23 | Note that the entire build environment will require about 30GB of disk space (on Windows). Moving the vcpkg-directory after it has been created and populated can also cause issue due to paths no longer being correct. 24 | 25 | ### Windows 26 | 27 | You will need Git, CMake and MSVC. 28 | 29 | If you want to create an installer you will also need the [WiX Toolset](https://wixtoolset.org/). 30 | 31 | #### Git 32 | 33 | The dependency download and build script requires [Git for Windows](https://git-scm.com/download/win). During installation, make sure the option to set Environment Variables is ticked. It is also suggested to add the Git install directory (i.e. `%ProgramFiles%\Git`) to the User `PATH` (or System `PATH` if a multi-user PC) environment variable if using cmd or PowerShell to run the script. 34 | 35 | #### CMake (Windows) 36 | 37 | Download and install the current version of [CMake](https://cmake.org/download/). If you want to use an existing installation of CMake make sure you use **version 3.15 or later**. 38 | 39 | #### MSVC 40 | 41 | MSVC (Microsoft Visual C++) is Microsoft’s C++ compiler toolchain. It can be installed from Visual Studio Build Tools, or Visual Studio Community. Either can be downloaded [here](https://visualstudio.microsoft.com/downloads) (Any somewhat recent version should work). 42 | 43 | Make sure to select the **C++ build tools** (or Development, respectively) and "**C++ MFC for latest v14[X] build tools**" (just pick the latest version - e.g.`v142`). vcpkg also requires the **English Language pack** which is found in the Language packs section of the Visual Studio Installer. 44 | 45 | #### Preparing build dependencies (Windows) 46 | 47 | Open a Powershell window as a regular user and issue the following command: 48 | 49 | `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` 50 | 51 | Move into this projects directory with the `cd` command. Run the following command: 52 | 53 | `./Get-MumbleDeps.ps1` 54 | 55 | By default this will create a vcpkg directory in you user's directory (`C:\Users\\mumble-vcpkg`). If you want this directory to be somewhere else, you have to modify `Get-MumbleDeps.ps1` and change the first lines accordingly. 56 | 57 | ### GNU/Linux and MacOSX 58 | 59 | #### CMake (Linux/Mac) 60 | 61 | Install CMake via your package manager (yum, apt, etc…). Make sure it is **version 3.15 or later**. 62 | 63 | If your package manager doesn't provide a recent enough cmake version and you're on Ubuntu (or any of its derivatives, e.g. Linux Mint, Kubuntu, etc.) you can install cmake via a PPA. To do so, follow the instructions [here](https://apt.kitware.com/). 64 | 65 | #### Build dependencies 66 | 67 | Additional `dev` packages will need to be installed for some components in vcpkg on GNU/Linux: 68 | 69 | * `libxi(X11)` 70 | * `libgl1-mesa` 71 | * `libglu1-mesa` 72 | * `mesa-common` 73 | * `libxrandr` 74 | * `libxxf86vm` 75 | 76 | vcpkg will also require installation of: 77 | 78 | * `python3` 79 | * `python2` 80 | * `python` 81 | 82 | Most GNU/Linux distros should have these or equivalent packages. 83 | 84 | The following is required for MacOSX: 85 | 86 | `Xquartz` 87 | 88 | vcpkg recommends using `gcc` which can be installed using homebrew. 89 | 90 | #### Preparing build dependencies (Linux/Mac) 91 | 92 | From a terminal cd to the cloned `mumble-releng-vcpkg` git repository, set execute permission (`chmod u+x get-mumble_deps.sh`), and run the following command: 93 | 94 | `./get-mumble_deps.sh` 95 | 96 | This will clone `vcpkg` and install the dependencies in the user's home directory. If you want to change the path, you have to edit `get-mumble_deps.sh` accordingly. 97 | 98 | ## Building Mumble 99 | 100 | Mumble (server and client) are built with CMake since version 1.4.0. 101 | 102 | ### Command Line 103 | 104 | 1. Start a command line (on Windows see caveats listed below) 105 | 2. Clone the Mumble repo 106 | 3. Navigate into the folder 107 | 5. Create a directory named `build` and navigate into it (`mkdir build && cd build`) 108 | 6. Run the cmake generator with relative target path `..` (more on that further down) 109 | 7. Run the cmake in build-mode: `cmake --build .` or invoke your buildsystem of choice directly (e.g. `make -j $(nproc)`) 110 | 111 | CMake will generate a bunch of files so you should call it from a dedicated, empty directory ("out-of-source build"). Typically one folder per build configuration type is used (debug vs release, static, build configuration options etc). In the list above we suggest `build`. 112 | 113 | #### Windows caveats 114 | 115 | On Windows you can't use the default command-prompt (as is) as it won't have the needed development tools in its PATH. Instead you have to use On Windows a "Developer Command Prompt". You can find it by searching in the start-menu. If you are on a 64bit system, then special care must be taken that you use a "x64" version of the Developer Prompt (often these are then called "x64 Native Tools Command Prompt"). The easiest way to get a hold of the correct command prompt is to search for "x64" and usually that is enough to bring the x64 developer prompt up. 116 | 117 | Note also that you **have** to use the command prompt and **not** the Developer Powershell as the latter is always 32bit only. 118 | 119 | If you are on a 64bit system, then you'll know that you have opened the correct prompt, if it prints `Environment initialized for: 'x64'`. 120 | 121 | #### CMake Generator 122 | 123 | Important configuration options 124 | 125 | | Option | Value | Description | 126 | | --- | --- | --- | 127 | | `VCPKG_TARGET_TRIPLET` | `x64-windows-static-md` or `x64-linux` or `x64-osx` | The vcpkg triplet of your build and built dependencies | 128 | | `CMAKE_TOOLCHAIN_FILE` | `/scripts/buildsystems/vcpkg.cmake` | | 129 | | `Ice_HOME` | `/installed/x64-windows-static-md` | Required if you build with Ice (enabled by default) | 130 | | `static` | `ON` on Windows | Whether the build is a static build (otherwise dynamic) (environment default on Windows) | 131 | 132 | `` is a placeholder for your prepared build environment vcpkg setup (the path to the vcpkg directory created by the get-dependency script). 133 | 134 | For Linux the command may be (using the default generator `make`) 135 | 136 | ```bash 137 | cmake "-DVCPKG_TARGET_TRIPLET=x64-linux" "-DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake" "-DIce_HOME=/installed/x64-linux" "-DCMAKE_BUILD_TYPE=Release" .. 138 | ``` 139 | 140 | For Windows the command may be 141 | 142 | ```bash 143 | cmake -G "NMake Makefiles" "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md" "-Dstatic=ON" "-DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake" "-DIce_HOME=/installed/x64-windows-static-md" "-DCMAKE_BUILD_TYPE=Release" .. 144 | ``` 145 | 146 | Optionally you can use `-G "Ninja"` to use the [Ninja buildsystem](https://ninja-build.org/) (which probably has to be installed separately). Especially on Windows this is recommended as the default `NMake Makefiles` only compile using a single thread (which takes quite a while). 147 | 148 | Additional Mumble project build configuration can be passed with `-D` defines. For the full list see the output of `cmake -LH ..` (this also includes a lot of options from Mumble's dependencies like Qt and Opus) or use `cmake-gui`. 149 | 150 | | Option Define | Default | Description | 151 | | --- | --- | --- | 152 | | `-Dstatic=` | OFF | static linking of libraries (integrate) | 153 | | `-Dsymbols=` | OFF | Build symbols | 154 | | `-Dclient=` | ON | Build the client application | 155 | | `-Dserver=` | ON | Build the server application | 156 | | `-DBUILD_TESTING=` | OFF | Build tests | 157 | | `-Dpackaging=` | OFF | Build installer | 158 | | `-Doverlay=` | ON | Build the overlay feature | 159 | | `-Dice=` | ON | Build with Ice feature | 160 | | `-Dgrpc=` | OFF | Build with gRPC feature (experimental) | 161 | | `-Djackaudio=` | OFF | Build with jack feature | 162 | | `-Dplugins=` | ON | Build positional audio plugins | 163 | | `-Ddebug-dependency-search=` | OFF | Print extended information during the dependency search. Useful if some dependencies can't be found | 164 | 165 | To build only the server you could use 166 | 167 | ```bash 168 | cmake -G "NMake Makefiles" "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md" "-Dstatic=ON" "-DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake" "-DIce_HOME=/installed/x64-windows-static-md" "-Dsymbols=ON" "-Dclient=OFF" "-DCMAKE_BUILD_TYPE=Release" 169 | ``` 170 | 171 | #### CMake Build 172 | 173 | Once the project has completed configuration without errors, you can build it from the `build` directory with 174 | 175 | ``` 176 | cmake --build . 177 | ``` 178 | 179 | Windows builds can be done from a Developer Command prompt like this: 180 | 181 | ``` 182 | cmake --build . --config 183 | ``` 184 | 185 | `` can be specified as `Debug` or `Release`. 186 | 187 | Depending on the generator you used you can also use the generated make files (e.g. by calling `nmake`, `make`, `ninja` or `msbuild`). 188 | 189 | #### Create an installer 190 | 191 | Currently, the installer creation has been tested on Windows. 192 | 193 | An installer can be created after CMake-generating with `-Dpackaging=ON` and building. 194 | 195 | To create a single-language installer (default English) run `cpack -C Release`. 196 | 197 | To create a multi-language installer run the script `scripts/Create-Win32InstallerMUI.ps1`. 198 | 199 | ### Visual Studio (IDE) 200 | 201 | [Visual Studio supports CMake projects](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019) when you install the *C++ CMake tools for Windows* in the Visual Studio Installer. 202 | 203 | * Start Visual Studio 204 | * Open the project folder (with the open folder option) 205 | * In the CMake configuration settings specify the CMake toolchain file 206 | This file should be at `%USERPROFILE%/mumble-vcpkg/scripts/buildsystems/vcpkg.cmake` after using `get-mumble_deps.sh`. 207 | * As CMake command argument add `-DVCPKG_TARGET_TRIPLET=x64-windows-static-md -Dstatic=ON -DIce_HOME=%USERPROFILE%/mumble-vcpkg/installed/x64-windows-static-md` 208 | * Save and CMake should generate the build files, which will take a bit of time 209 | * Use the build all action to build the project 210 | * On success the built binaries will be placed in `out\build\\` 211 | 212 | Note: Visual Studio may wrongfully identify the error `The system was unable to find the specified registry key or value.` despite the build succeeding. This is due to a VS script that outputs `ERROR` as text early on in the build process. The queried registry key is not required for the build to succeed. Check the text Output or for other errors instead and **ignore this specific error**. 213 | 214 | ### Other IDEs with CMake support 215 | 216 | IDE's such as Qt Creator, Visual Studio and VS Code (Code OSS) are capable of handling the configure and build step as part of the normal operation of the IDE. The options listed above are "Configure Arguments" and would need to be added for the project or workspace settings in the IDE when the source folder is opened as a CMake project. 217 | 218 | ## Technical Details 219 | 220 | We use vcpkg to manage dependencies; to download, compile them and to include them in our own project build. 221 | 222 | We use CMake as our build system and to include the dependencies. vcpkg uses and encourages CMake, and CMake is well established in the C++ project space. 223 | 224 | ### Forks of zeroc-ice and vcpkg for Ice 3.7 CMake 225 | 226 | ZeroC Ice 3.7 is not a CMake project. We implemented it as a CMake project so we can integrate it in our CMake project. However, ZeroC does not want to integrate it into upstream 3.7. They are still undecided if they want to use CMake for future versions or a different build system. 227 | 228 | As a result we have to [fork the zeroc-ice project](https://github.com/mumble-voip/ice) to integrate our CMake project of it. 229 | 230 | 231 | ## Troubleshooting 232 | 233 | ### sndfile not found 234 | 235 | This is an error that is often encountered on 64bit Windows systems. The problem is usually that you have used the wrong developer command prompt and therefore cmake is trying to build a 32bit version of Mumble. The `./Get-MumbleDeps.ps1` script automatically detects your system's architecture and only builds the 64bit version of the libraries (including `sndfile`). cmake then tries to locate a 32bit version of the library and fails as only the 64bit version is present. 236 | 237 | The solution is to use a x64 developer command prompt. You can see what kind of build cmake is performing at the top of the cmake output. For 64 bit it should say `Architecture: 64bit`. 238 | 239 | NOTE: If you initially have run cmake from the wrong prompt (32bit), then you'll have to delete all files in your `build` directory before running cmake again from the new prompt. Otherwise cmake will not check the architecture again and proceed with the cached 32bit variant. 240 | 241 | ### CMake can't find library 242 | 243 | If cmake doesn't find a library and you don't really know why this might be, you can use `-Ddebug-dependency-search=ON` when running cmake in order to get a lot of debug information regarding the search for the needed dependencies. Chances are that this will shed some light on the topic. 244 | 245 | ### Unable to download from https://repo.msys2.org 246 | 247 | This can happen if you're using a system that doesn't support TLS 1.3 (which https://repo.msys2.org requires) such as Windows 7. In this case the only possible workaround is either to download the respective files manually using a brower that does support TLS 1.3 (e.g. Firefox) or to replace all occurences of `https://repo.msys2.org` in the vcpkg dir with `http://repo.msys2.org` and thereby forxing vcpkg to use the HTTP mirror instead. Note though that this is inherently unsafer than using HTTPS. 248 | 249 | A common error message for this scenario could be 250 | ``` 251 | -- Acquiring MSYS2... 252 | -- Downloading https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20190524.tar.xz/download... 253 | -- Downloading https://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz... 254 | -- Downloading https://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz... Failed. Status: 35;"SSL connect error" 255 | CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:173 (message): 256 | 257 | Failed to download file. 258 | If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment 259 | variables to "https://user:password@your-proxy-ip-address:port/". 260 | Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issue 261 | ``` 262 | Ref: https://github.com/microsoft/vcpkg/issues/13217 263 | --------------------------------------------------------------------------------