diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 4b0851a0..fc0857e4 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -20,7 +20,7 @@ jobs: run: | sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list sudo apt update - sudo apt install --allow-downgrades cmake ninja-build extra-cmake-modules libpcap0.8-dev libsdl2-dev \ + sudo apt install --allow-downgrades cmake ninja-build extra-cmake-modules libpcap0.8-dev libsdl2-dev libenet-dev \ qt6-{base,base-private,multimedia}-dev libarchive-dev libzstd-dev libfuse2 - name: Configure run: cmake -B build -G Ninja -DUSE_QT6=ON -DCMAKE_INSTALL_PREFIX=/usr diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt index a7de6253..6ca24de6 100644 --- a/src/net/CMakeLists.txt +++ b/src/net/CMakeLists.txt @@ -25,5 +25,11 @@ else() target_link_libraries(net-utils PUBLIC slirp) endif() -find_package(ENet REQUIRED) -target_link_libraries(net-utils PUBLIC enet) +if (USE_VCPKG) + find_package(unofficial-enet CONFIG REQUIRED) + target_link_libraries(net-utils PRIVATE unofficial::enet::enet) +else() + pkg_check_modules(ENet REQUIRED IMPORTED_TARGET libenet) + fix_interface_includes(PkgConfig::ENet) + target_link_libraries(net-utils PUBLIC PkgConfig::ENet) +endif()