CPP Adaption #60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest] | |
| env: | |
| CMAKE_BUILD_TYPE: Release | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up CMake | |
| uses: lukka/[email protected] | |
| - name: Cache vcpkg (Windows) | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| vcpkg/packages | |
| vcpkg/buildtrees | |
| vcpkg/installed | |
| key: windows-vcpkg-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: windows-vcpkg- | |
| - name: Install dependencies (Windows) | |
| shell: pwsh | |
| run: | | |
| choco install cmake git openssl -y | |
| # OpenCV and Pcap might require manual handling or vcpkg if not prebuilt | |
| git clone https://github.com/microsoft/vcpkg | |
| .\vcpkg\bootstrap-vcpkg.bat | |
| .\vcpkg\vcpkg install opencv:x64-windows pcap:x64-windows | |
| .\vcpkg\vcpkg pcapplusplus:x64-windows | |
| echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" >> $env:GITHUB_ENV | |
| echo "CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" >> $env:GITHUB_ENV | |
| - name: Configure and Build (Windows) | |
| shell: pwsh | |
| run: | | |
| cd heiFIP/ | |
| # Create build directory | |
| mkdir -p build && cd build | |
| cmake .. \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DUSE_MANUAL_PCAPPLUSPLUS=ON \ | |
| -DPcapPlusPlus_INCLUDE_DIRS="${env:GITHUB_WORKSPACE}\pcappp\include" \ | |
| -DPcapPlusPlus_LIBRARIES="${env:GITHUB_WORKSPACE}\pcappp\lib\libCommon++.lib;${env:GITHUB_WORKSPACE}\pcappp\lib\libPacket++.lib;${env:GITHUB_WORKSPACE}\pcappp\lib\libPcap++.lib" \ | |
| -DUSE_MANUAL_OPENSSL=ON \ | |
| -DOPENSSL_INCLUDE_DIR="C:\Program Files\OpenSSL-Win64\include" \ | |
| -DOPENSSL_CRYPTO_LIBRARY="C:\Program Files\OpenSSL-Win64\lib\libcrypto.lib" | |
| make -j$(nproc) | |
| cmake --build build |