Add guide for building chatterino2 on Windows with vcpkg (#3634)

This commit is contained in:
Ian 2022-05-15 17:57:31 +02:00 committed by GitHub
parent 3119a9bab3
commit addcbb10f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 65 additions and 3 deletions

3
.gitignore vendored
View file

@ -104,3 +104,6 @@ Stamp
tmp
Source
Dependencies_*
# vcpkg
vcpkg_installed/

View file

@ -0,0 +1,35 @@
# Building on Windows with vcpkg
## Prerequisites
1. Install [Visual Studio](https://visualstudio.microsoft.com/) with "Desktop development with C++" (~9.66 GB)
1. Install [CMake](https://cmake.org/) (~109 MB)
1. Install [git](https://git-scm.com/) (~264 MB)
1. Install [vcpkg](https://vcpkg.io/) (~80 MB)
- `git clone https://github.com/Microsoft/vcpkg.git`
- `cd .\vcpkg\`
- `.\bootstrap-vcpkg.bat`
- `.\vcpkg integrate install`
- `.\vcpkg integrate powershell`
- `cd ..`
1. Configure the environment for vcpkg
- `set VCPKG_DEFAULT_TRIPLET=x64-windows`
- [default](https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#additional-remarks) is `x86-windows`
- `set VCPKG_ROOT=C:\path\to\vcpkg\`
- `set PATH=%PATH%;%VCPKG_ROOT%`
## Building
1. Clone
- `git clone --recurse-submodules https://github.com/Chatterino/chatterino2.git`
1. Install dependencies (~21 GB)
- `cd .\chatterino2\`
- `vcpkg install`
1. Build
- `mkdir .\build\`
- `cd .\build\`
- (cmd) `cmake .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake`
- (ps1) `cmake .. -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"`
- `cmake --build . --parallel <threads> --config Release`
1. Run
- `.\bin\chatterino2.exe`

View file

@ -59,6 +59,7 @@ find_package(Sanitizers)
# Find boost on the system
find_package(Boost REQUIRED)
find_package(Boost COMPONENTS random)
# Find OpenSSL on the system
find_package(OpenSSL REQUIRED)

View file

@ -36,6 +36,8 @@ git submodule update --init --recursive
[Building on Windows](../master/BUILDING_ON_WINDOWS.md)
[Building on Windows with vcpkg](../master/BUILDING_ON_WINDOWS_WITH_VCPKG.md)
[Building on Linux](../master/BUILDING_ON_LINUX.md)
[Building on Mac](../master/BUILDING_ON_MAC.md)

View file

@ -649,7 +649,7 @@ if (WIN32)
endif ()
if (MSVC)
target_compile_options(${LIBRARY_PROJECT} PUBLIC /EHsc)
target_compile_options(${LIBRARY_PROJECT} PUBLIC /EHsc /bigobj)
endif ()
if (APPLE AND BUILD_APP)
@ -682,7 +682,7 @@ if (USE_CONAN AND TARGET CONAN_PKG::boost)
else ()
target_link_libraries(${LIBRARY_PROJECT}
PUBLIC
Boost::boost
${Boost_LIBRARIES}
)
endif ()

View file

@ -25,7 +25,7 @@ add_sanitizers(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-lib)
target_link_libraries(${PROJECT_NAME} PRIVATE gtest)
target_link_libraries(${PROJECT_NAME} PRIVATE ${GTEST_BOTH_LIBRARIES})
target_compile_definitions(${PROJECT_NAME} PRIVATE
CHATTERINO_TEST

21
vcpkg.json Normal file
View file

@ -0,0 +1,21 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "chatterino",
"version": "2.0.0",
"dependencies": [
"benchmark",
"boost-asio",
"boost-foreach",
"boost-interprocess",
"boost-random",
"boost-variant",
"gtest",
"openssl",
"qt5-multimedia",
"qt5-tools"
],
"builtin-baseline": "2ac61f87f69f0484b8044f95ab274038fbaf7bdd",
"overrides": [
{ "name": "openssl", "version-string": "1.1.1n" }
]
}