mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-08-03 03:17:22 -04:00
Add support for vcpkg (#3742)
This commit is contained in:
commit
af73cfa20f
@ -25,6 +25,31 @@ runs:
|
||||
arch: ${{ inputs.vcvars-arch }}
|
||||
vsversion: 2022
|
||||
|
||||
- name: Setup vcpkg cache (MSVC)
|
||||
if: ${{ inputs.msystem == '' && inputs.build-type == 'Debug' }}
|
||||
shell: pwsh
|
||||
env:
|
||||
USERNAME: ${{ github.repository_owner }}
|
||||
FEED_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
|
||||
run: |
|
||||
.$(vcpkg fetch nuget) `
|
||||
sources add `
|
||||
-Source "$env:FEED_URL" `
|
||||
-StorePasswordInClearText `
|
||||
-Name GitHubPackages `
|
||||
-UserName "$env:USERNAME" `
|
||||
-Password "$env:GITHUB_TOKEN"
|
||||
.$(vcpkg fetch nuget) `
|
||||
setapikey "$env:GITHUB_TOKEN" `
|
||||
-Source "$env:FEED_URL"
|
||||
Write-Output "VCPKG_BINARY_SOURCES=clear;nuget,$env:FEED_URL,readwrite" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Setup vcpkg environment (MSVC)
|
||||
if: ${{ inputs.msystem == '' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Setup MSYS2 (MinGW)
|
||||
if: ${{ inputs.msystem != '' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -69,6 +69,10 @@ jobs:
|
||||
build:
|
||||
name: Build (${{ matrix.artifact-name }})
|
||||
|
||||
permissions:
|
||||
# Required for vcpkg binary cache
|
||||
packages: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
@ -348,6 +348,14 @@ endif()
|
||||
if(NOT Launcher_FORCE_BUNDLED_LIBS)
|
||||
# Find toml++
|
||||
find_package(tomlplusplus 3.2.0 QUIET)
|
||||
# Fallback to pkg-config (if available) if CMake files aren't found
|
||||
if(NOT tomlplusplus_FOUND)
|
||||
find_package(PkgConfig)
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(tomlplusplus IMPORTED_TARGET tomlplusplus>=3.2.0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Find cmark
|
||||
find_package(cmark QUIET)
|
||||
|
@ -1309,12 +1309,16 @@ target_link_libraries(Launcher_logic
|
||||
Launcher_murmur2
|
||||
nbt++
|
||||
${ZLIB_LIBRARIES}
|
||||
tomlplusplus::tomlplusplus
|
||||
qdcss
|
||||
BuildConfig
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
qrcodegenerator
|
||||
)
|
||||
if(TARGET PkgConfig::tomlplusplus)
|
||||
target_link_libraries(Launcher_logic PkgConfig::tomlplusplus)
|
||||
else()
|
||||
target_link_libraries(Launcher_logic tomlplusplus::tomlplusplus)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT CYGWIN AND NOT APPLE)
|
||||
target_link_libraries(Launcher_logic
|
||||
|
14
vcpkg-configuration.json
Normal file
14
vcpkg-configuration.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"default-registry": {
|
||||
"kind": "git",
|
||||
"baseline": "0c4cf19224a049cf82f4521e29e39f7bd680440c",
|
||||
"repository": "https://github.com/microsoft/vcpkg"
|
||||
},
|
||||
"registries": [
|
||||
{
|
||||
"kind": "artifact",
|
||||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
|
||||
"name": "microsoft"
|
||||
}
|
||||
]
|
||||
}
|
10
vcpkg.json
Normal file
10
vcpkg.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"bzip2",
|
||||
"cmark",
|
||||
{ "name": "ecm", "host": true },
|
||||
{ "name": "pkgconf", "host": true },
|
||||
"tomlplusplus",
|
||||
"zlib"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user