mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-17 11:05:05 +02:00
install depends via vcpkg on Windows
This commit is contained in:
65
.github/workflows/gha.yml
vendored
65
.github/workflows/gha.yml
vendored
@@ -266,69 +266,44 @@ jobs:
|
|||||||
pattern: [0, 1, 2, 3]
|
pattern: [0, 1, 2, 3]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Cache dependencies
|
- name: Cache vcpkg
|
||||||
id: cache-depends
|
id: cache-vcpkg
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: third_party
|
path: C:/vcpkg/installed/x64-windows
|
||||||
key: ${{ runner.os }}-depends
|
key: ${{ runner.os }}-vcpkg
|
||||||
- name: Build dependencies
|
- name: Build dependencies
|
||||||
if: steps.cache-depends.outputs.cache-hit != 'true'
|
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$CUR=(Get-Location).Path
|
vcpkg install gtest:x64-windows
|
||||||
|
vcpkg install zlib:x64-windows
|
||||||
Invoke-WebRequest -Uri https://github.com/google/googletest/archive/release-1.7.0.zip -OutFile googletest-release-1.7.0.zip
|
|
||||||
7z x googletest-release-1.7.0.zip
|
|
||||||
cd googletest-release-1.7.0
|
|
||||||
md build
|
|
||||||
cd build
|
|
||||||
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" ..
|
|
||||||
cmake --build . --config Release
|
|
||||||
New-Item -ItemType Directory -Path "$CUR\third_party\googletest\lib"
|
|
||||||
Copy-Item "Release\*" -Destination "$CUR\third_party\googletest\lib"
|
|
||||||
Copy-Item -Path "..\include" -Destination "$CUR\third_party\googletest" -Recurse
|
|
||||||
cd ..
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
Invoke-WebRequest -Uri http://zlib.net/zlib-1.2.11.tar.gz -OutFile zlib-1.2.11.tar.gz
|
|
||||||
7z x zlib-1.2.11.tar.gz
|
|
||||||
7z x zlib-1.2.11.tar
|
|
||||||
cd zlib-1.2.11
|
|
||||||
md build
|
|
||||||
cd build
|
|
||||||
cmake -DCMAKE_INSTALL_PREFIX="$CUR\third_party\zlib" ..
|
|
||||||
cmake --build . --config Release
|
|
||||||
New-Item -ItemType Directory -Path "$CUR\third_party\zlib\lib"
|
|
||||||
Copy-Item "Release\*" -Destination "$CUR\third_party\zlib\lib"
|
|
||||||
Copy-Item "..\zlib.h" -Destination "$CUR\third_party\zlib"
|
|
||||||
Copy-Item zconf.h -Destination "$CUR\third_party\zlib"
|
|
||||||
- name: Build and test
|
- name: Build and test
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
if (${{ matrix.pattern }} -eq 0) {
|
if (${{ matrix.pattern }} -eq 0) {
|
||||||
$CPP11="-DMSGPACK_CXX11=""OFF"""
|
$CPP11="-DMSGPACK_CXX11=OFF"
|
||||||
$BOOST="-DMSGPACK_BOOST=""OFF"""
|
$BOOST="-DMSGPACK_BOOST=OFF"
|
||||||
}
|
}
|
||||||
if (${{ matrix.pattern }} -eq 1) {
|
if (${{ matrix.pattern }} -eq 1) {
|
||||||
$CPP11="-DMSGPACK_CXX11=""OFF"""
|
$CPP11="-DMSGPACK_CXX11=OFF"
|
||||||
$BOOST="-DMSGPACK_BOOST=""ON"""
|
$BOOST="-DMSGPACK_BOOST=ON"
|
||||||
}
|
}
|
||||||
if (${{ matrix.pattern }} -eq 2) {
|
if (${{ matrix.pattern }} -eq 2) {
|
||||||
$CPP11="-DMSGPACK_CXX11=""ON"""
|
$CPP11="-DMSGPACK_CXX11=ON"
|
||||||
$BOOST="-DMSGPACK_BOOST=""OFF"""
|
$BOOST="-DMSGPACK_BOOST=OFF"
|
||||||
}
|
}
|
||||||
if (${{ matrix.pattern }} -eq 3) {
|
if (${{ matrix.pattern }} -eq 3) {
|
||||||
$CPP11="-DMSGPACK_CXX11=""ON"""
|
$CPP11="-DMSGPACK_CXX11=ON"
|
||||||
$BOOST="-DMSGPACK_BOOST=""ON"""
|
$BOOST="-DMSGPACK_BOOST=ON"
|
||||||
}
|
}
|
||||||
|
|
||||||
$CUR=(Get-Location).Path
|
$CUR=(Get-Location).Path
|
||||||
md build
|
md build
|
||||||
cd build
|
cd build
|
||||||
echo $env:BOOST_ROOT
|
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" $CPP11 $BOOST "-DCMAKE_CXX_FLAGS=/D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" ..
|
||||||
$env:BOOST_ROOT="$env:Boost_ROOT"
|
|
||||||
cmake -DBOOST_ROOT="$env:BOOST_ROOT" $CPP11 $BOOST $X3_PARSE -DGTEST_LIBRARY="$CUR\third_party\googletest\lib\gtest.lib" -DGTEST_MAIN_LIBRARY="$CUR\third_party\googletest\lib\gtest_main.lib" -DGTEST_INCLUDE_DIR="$CUR\third_party\googletest\include" -DZLIB_LIBRARY="$CUR\third_party\zlib\lib\zlib.lib" -DZLIB_INCLUDE_DIR="$CUR\third_party\zlib" -DCMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" ..
|
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
$env:PATH="$env:PATH;$CUR\third_party\googletest\lib;$CUR\third_party\zlib\lib;$CUR\build\Release"
|
$pathbak="$env:PATH"
|
||||||
|
$env:PATH="C:\vcpkg\installed\x64-windows\bin;$CUR\build\Release;$pathbak"
|
||||||
ctest -V
|
ctest -V
|
||||||
|
$env:PATH=$pathbak
|
||||||
|
Reference in New Issue
Block a user