Skip to content

Commit

Permalink
[CI] switch windows to using vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
em-eight committed Sep 28, 2023
1 parent 5f201d8 commit be08179
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@ jobs:
- name: Install Ninja
run: choco install -y ninja

- name: Download protobuf
- name: Setup vcpkg
shell: bash
run: |
Invoke-WebRequest "https://www.dropbox.com/scl/fi/te9p80zrzcwgswrkw21en/protobuf_x64-windows.zip?rlkey=btmzjokhh256xxns348o3re7m&dl=1" -OutFile protobuf_x64-windows.zip
7z x protobuf_x64-windows.zip
dir
where vcpkg
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
where vcpkg
./vcpkg/vcpkg install protobuf:x64-windows-static
- name: CMake generate
shell: bash
env:
ARTIFACT_NAME: ppc2cpp-${{ runner.os }}
run: |
cmake -S . -B build -GNinja \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_LIBRARY_LINKAGE=static \
-DVCPKG_TARGET_TRIPLET=x64-windows-static \
-Dprotobuf_MSVC_STATIC_RUNTIME=ON \
-DCMAKE_INSTALL_PREFIX=$ARTIFACT_NAME \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CPMAddPackage(
CPMAddPackage("gh:fmtlib/fmt#10.0.0")

set(Protobuf_USE_STATIC_LIBS ON)
set(VCPKG_LIBRARY_LINKAGE static) # for vcpkg

find_package(protobuf CONFIG)
if(NOT protobuf_FOUND) # Legacy protobuf support
Expand Down

0 comments on commit be08179

Please sign in to comment.