From df08e4e64179631999bdae90ad023a3e001c93d0 Mon Sep 17 00:00:00 2001 From: eugene Date: Mon, 22 Jul 2024 14:05:01 -0400 Subject: [PATCH] bump vcpkg and use more robust libsodium config --- .github/actions/build/action.yml | 18 +++++++++++++----- library/CMakeLists.txt | 15 +++++++++------ vcpkg.json | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index ab470a27..b518773f 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -20,6 +20,16 @@ inputs: runs: using: "composite" steps: + - name: macOS tools + if: runner.os == 'macOS' + shell: bash + run: brew install autoconf autoconf-archive automake pkg-config + + - name: windows tools + if: runner.os == 'Windows' + shell: bash + run: choco install pkgconfiglite + - name: simple build run: echo "target = ${{ inputs.target }}" shell: bash @@ -29,13 +39,11 @@ runs: go-version: '1.22.x' cache-dependency-path: "**/*.sum" - - uses: lukka/get-cmake@v3.27.6 + - uses: lukka/get-cmake@v3.30.1 - - uses: lukka/run-vcpkg@v10 - with: - vcpkgGitCommitId: 'c8696863d371ab7f46e213d8f5ca923c4aef2a00' + - uses: lukka/run-vcpkg@v11 - - uses: lukka/run-cmake@v10.6 + - uses: lukka/run-cmake@v10 name: Configure CMake with: configurePreset: ci-${{ inputs.target }} diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index edbb6409..e989cc16 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,17 +1,20 @@ include(FindPkgConfig) +find_package(PkgConfig) if (TARGET sodium) set(sodium_libs sodium) else () - find_package(unofficial-sodium) - if (unofficial-sodium_FOUND) + # prefer package config (libsodium provided) + # over unofficial VCPKG CMake Config + pkg_check_modules(sodium IMPORTED_TARGET libsodium) + if (sodium_FOUND) + set(sodium_libs PkgConfig::sodium) + message("sodium[${sodium_VERSION}] is ${sodium_LINK_LIBRARIES}") + else () + find_package(unofficial-sodium REQUIRED) set(sodium_libs unofficial-sodium::sodium) get_target_property(sodium_loc unofficial-sodium::sodium LOCATION) message("sodium is ${sodium_loc}") - else () - find_package(PkgConfig) - pkg_check_modules(sodium libsodium) - set(sodium_libs ${sodium_LIBRARIES}) endif () endif () if (NOT sodium_libs) diff --git a/vcpkg.json b/vcpkg.json index 0bafa3a6..9c0674fd 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -33,5 +33,5 @@ ] } }, - "builtin-baseline": "c8696863d371ab7f46e213d8f5ca923c4aef2a00" + "builtin-baseline": "1de2026f28ead93ff1773e6e680387643e914ea1" }