Skip to content

Commit

Permalink
bump vcpkg and use more robust libsodium config
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoby committed Jul 23, 2024
1 parent 89ef643 commit df08e4e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
18 changes: 13 additions & 5 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
15 changes: 9 additions & 6 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
]
}
},
"builtin-baseline": "c8696863d371ab7f46e213d8f5ca923c4aef2a00"
"builtin-baseline": "1de2026f28ead93ff1773e6e680387643e914ea1"
}

0 comments on commit df08e4e

Please sign in to comment.