Updated Building KeePassXC (markdown)

Janek Bevendorff
2024-02-19 23:46:18 +01:00
parent 41c44b1a35
commit 091c7b475b

@@ -99,22 +99,22 @@ If you installed Qt5 via Homebrew and CMake fails to find your Qt installation,
When building with ASAN support on macOS, you need to use `export ASAN_OPTIONS=detect_leaks=0` before running the tests (LSAN is no supported on macOS).
### Windows
The preferred way to build on Windows is using MSVC, for which you have to open an _MSVC Tools Command Prompt_. If instead, you are using MSYS2, open a _MSYS2 MinGW_ terminal (*not* _MSYS2 MSYS_ which is the default).
The preferred way to build on Windows is using MSVC, for which you have to open an _MSVC Tools Command Prompt_. If instead, you are using Msys2, open a _MSYS2 MinGW_ terminal (*not* _MSYS2 MSYS_ which is the default).
Download and unpack the source code as described in the [Linux](#linux) section. To build KeePassXC with MSVC, change into the source code directory and run:
Download and unpack the source code as described in the [Linux](#linux) section. To build KeePassXC with MSVC, open a PowerShell, change into the source code directory, and run:
```
mkdir build
cd build
cmake \
-DWITH_XC_ALL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake \
cmake ^
-DWITH_XC_ALL=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ..
make -j8 package
```
Make sure that `-DCMAKE_TOOLCHAIN_FILE` points to the correct path of your vcpkg installation.
If you build with Msys2, omit `-DCMAKE_TOOLCHAIN_FILE` and `-DVCPKG_TARGET_TRIPLET` altogether and add `-G "MSYS Makefiles"` instead.
If you build with Msys2, omit `-DCMAKE_TOOLCHAIN_FILE` and `-DVCPKG_TARGET_TRIPLET` altogether and add `-G "MSYS Makefiles"` instead. Replace `^` with `\` if running in a Unix shell.
## 3. Running tests