Skip to content

Commit

Permalink
update vcpkg (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull authored Oct 22, 2024
1 parent cefb87f commit 414d049
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Prepare vcpkg
if: runner.os != 'Windows'
uses: friendlyanon/setup-vcpkg@v1
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
- uses: actions/cache@v2
id: cache
with:
path: |
/home/runner/vcpkg
/Users/runner/vcpkg/
ccache
deps/
c:/vcpkg
!c:/vcpkg/.git
!c:/vcpkg/buildtrees
!c:/vcpkg/packages
!c:/vcpkg/downloads
key: vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
Expand All @@ -49,11 +59,12 @@ jobs:
run: export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake . -DTESTS=ON
- name: configure
if: runner.os == 'Linux'
run: CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake . -DTESTS=ON
run: CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake . -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DTESTS=ON
- name: compile
run: make -j2
- name: run test
run: CTEST_OUTPUT_ON_FAILURE=TRUE make test ARGS="--output-on-failure"

build_with_gcc:
name: build_with_gcc
runs-on: ${{ matrix.os }}
Expand All @@ -64,10 +75,23 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Prepare vcpkg
if: runner.os != 'Windows'
uses: friendlyanon/setup-vcpkg@v1
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
- uses: actions/cache@v2
id: cache
with:
path: /home/runner/vcpkg
path: |
/home/runner/vcpkg
/Users/runner/vcpkg/
ccache
deps/
c:/vcpkg
!c:/vcpkg/.git
!c:/vcpkg/buildtrees
!c:/vcpkg/packages
!c:/vcpkg/downloads
key: vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
Expand All @@ -85,7 +109,7 @@ jobs:
- name: install Ubuntu dependencies
run: sudo apt install -y git curl build-essential cmake ccache lcov
- name: configure
run: cmake . -DTESTS=ON -DCOVERAGE=ON -DDEBUG=on
run: cmake . -DTESTS=ON -DCOVERAGE=ON -DDEBUG=on -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
- name: compile
run: make -j2
- name: run test
Expand All @@ -97,6 +121,7 @@ jobs:
with:
file: ./coverage.info
name: bcos-utilities coverage

build_with_centos:
name: build_with_centos
runs-on: ubuntu-latest
Expand Down Expand Up @@ -131,14 +156,15 @@ jobs:
cmake3 . -DTESTS=ON
make -j2
CTEST_OUTPUT_ON_FAILURE=TRUE make test ARGS="--output-on-failure"
build_with_windows:
name: build_with_windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 5
- uses: actions/cache@v2
Expand All @@ -163,7 +189,7 @@ jobs:
uses: microsoft/[email protected]
- name: configure
if: runner.os == 'Windows'
run: mkdir -p build && cd build && cmake -G "Visual Studio 16 2019" -A x64 ../
run: mkdir -p build && cd build && cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake ../
- name: compile
run:
cd build && MSBuild /version && MSBuild bcos-utilities.sln /p:Configuration=Release /p:Platform=x64
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ include(Options)
configure_project()

# vcpkg init
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
endif()

project(bcos-utilities VERSION "1.0.0")

Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 3512 files
4 changes: 2 additions & 2 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{
"kind": "git",
"repository": "https://github.com/FISCO-BCOS/registry",
"baseline": "3765dfb347d9fc820cfad9005b2f87d0755895ec",
"baseline": "b483a0287c6ee7017983942af540e3ee672b0994",
"packages": [
"tbb",
"boost-beast",
"boost-uuid"
]
}
]
}
}

0 comments on commit 414d049

Please sign in to comment.