From 472ecbb251ed3a4c367ba4e40e22e6e76506560c Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Mon, 20 Nov 2023 14:26:28 +0100 Subject: [PATCH] fixups Enable testing in windows --- .github/workflows/ci.yml | 14 ++++++++++++++ rebar.config | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c61a50..b3b74bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,9 +36,23 @@ jobs: with: path: ~/.cache/rebar3 key: rebar3-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}} + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + if: ${{ matrix.os == 'windows-2022' }} - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.12.1 if: ${{ matrix.os == 'windows-2022' }} + - name: vcpkg build + uses: johnwason/vcpkg-action@v5 + with: + pkgs: openssl + triplet: x64-windows-release + token: ${{ github.token }} + if: ${{ matrix.os == 'windows-2022' }} + # - name: Install OpenSSL + # run: powershell.exe .\.github\workflows\Install-OpenSSL.ps1 + # if: ${{ matrix.os == 'windows-2022' }} - run: rebar3 as test get-deps - run: rebar3 as test compile diff --git a/rebar.config b/rebar.config index 563a331..ff93d89 100644 --- a/rebar.config +++ b/rebar.config @@ -19,7 +19,7 @@ "$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC --coverage"}, {"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)", "$LDLIBS -lcrypto --coverage"}, - {"win32", "CFLAGS", "$CFLAGS /O0 /DNDEBUG /Wall"}, + {"win32", "CFLAGS", "$CFLAGS /I${OPENSSL_INSTALL_DIR}/include /O2 /DNDEBUG /Wall"}, {"win32", "LDLIBS", "$LDLIBS libcrypto.lib"} ] } @@ -35,7 +35,7 @@ "CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC"}, {"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)", "LDLIBS", "$LDLIBS -lcrypto"}, - {"win32", "CFLAGS", "$CFLAGS /O2 /DNDEBUG /Wall"}, + {"win32", "CFLAGS", "$CFLAGS /I${OPENSSL_INSTALL_DIR}/include /O2 /DNDEBUG /Wall"}, {"win32", "LDLIBS", "$LDLIBS libcrypto.lib"}, {"DRV_LINK_TEMPLATE", "$DRV_LINK_TEMPLATE $LDLIBS"} ]