Skip to content

Commit

Permalink
fix vcpkg reuse logic (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull authored Aug 21, 2024
1 parent b21a3fe commit 5bad27f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cpp_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ jobs:
export GCC='gcc-10'
export CXX='g++-10'
bash cpp/tools/install_depends.sh -o ubuntu
mkdir -p cpp/build && cd cpp/build && cmake -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
mkdir -p cpp/build && cd cpp/build && cmake -DTESTS=ON -DCOVERAGE=ON -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
make -j3
- name: Build for macos
if: runner.os == 'macOS'
run: |
bash cpp/tools/install_depends.sh -o macos
mkdir -p cpp/build && cd cpp/build && cmake -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
mkdir -p cpp/build && cd cpp/build && cmake -DTESTS=ON -DCOVERAGE=ON -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
make -j3
- name: Test
if: runner.os != 'Windows'
Expand Down
5 changes: 2 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ if(WIN32)
endif()

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

include(Version)
project(WeDPR-Component VERSION ${VERSION})

Expand Down
4 changes: 2 additions & 2 deletions cpp/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"registries": [
{
"kind": "git",
"repository": "https://github.com/FISCO-BCOS/registry",
"baseline": "070f336149afdac5cc9ace97df01de7ee31aab30",
"repository": "https://github.com/cyjseagull/registry",
"baseline": "7f641e8f28f73dc09f1349247b101a45a82ae431",
"packages": [
"openssl",
"bcos-utilities",
Expand Down

0 comments on commit 5bad27f

Please sign in to comment.