Skip to content

Commit

Permalink
Windows: Fix workflows OpenSSL install
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdeep1 authored and Jon Shallow committed Oct 4, 2023
1 parent 342a2d0 commit 9fbce39
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
env:
PLATFORM: posix
TESTS: yes
OPENSSL_INSTALL_PATH: C:\Program Files\OpenSSL-Win64\

jobs:
build-linux:
Expand Down Expand Up @@ -156,8 +155,7 @@ jobs:
uses: microsoft/setup-msbuild@v1

- name: Install OpenSSL on Windows (choco)
run: |
choco install openssl
run: call .\scripts\msinstallopenssl.cmd
shell: cmd

- name: Build sln
Expand All @@ -169,8 +167,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install OpenSSL on Windows (choco)
run: |
choco install openssl
run: call .\scripts\msinstallopenssl.cmd
shell: cmd

- name: MS CMake setup
Expand Down
9 changes: 9 additions & 0 deletions scripts/msbuild.sln.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ if exist NoTLS rd /s /q NoTLS

cd ..

REM Need to set OPENSSL_INSTALL_PATH so we can build with OpenSSL
IF EXIST "C:\Program Files\OpenSSL\include\openssl\ssl.h" (
SET "OPENSSL_INSTALL_PATH=C:\Program Files\OpenSSL\"
) ELSE (
SET "OPENSSL_INSTALL_PATH=C:\Program Files\OpenSSL-Win64\")
)

echo OPENSSL_INSTALL_PATH = %OPENSSL_INSTALL_PATH%

rem MSBuild.exe ./win32/libcoap.sln /p:Configuration=NoTLS /p:Platform=x64 /warnaserror
MSBuild.exe ./win32/libcoap.sln /p:Platform=x64 /warnaserror

Expand Down
5 changes: 5 additions & 0 deletions scripts/msinstallopenssl.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
IF NOT EXIST "C:\Program Files\OpenSSL\include\openssl\ssl.h" (
choco install openssl --no-progress
) ELSE (
echo OpenSSL already installed.
)

0 comments on commit 9fbce39

Please sign in to comment.