Skip to content

Commit

Permalink
Merge pull request #118 from kinke/fix_win_linking
Browse files Browse the repository at this point in the history
Make SIL plugin link on Windows
  • Loading branch information
skoppe authored Jun 18, 2022
2 parents 11848bf + 752b3c2 commit eada5d1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,15 @@ jobs:
with:
compiler: ${{ matrix.dc }}

- name: "Windows: install full OpenSSL package, copy & rename import libs, then add to LIB env var"
- name: "Windows: install full OpenSSL package, copy & rename import libs, then set KAL_EXT_LIB_WIN64 env var"
if: runner.os == 'Windows'
shell: cmd
run: |
choco install openssl --no-progress || exit /b
mkdir extern_deps || exit /b
copy "%PROGRAMFILES%\OpenSSL-Win64\lib\VC\libssl64MT.lib" extern_deps\libssl.lib || exit /b
copy "%PROGRAMFILES%\OpenSSL-Win64\lib\VC\libcrypto64MT.lib" extern_deps\libcrypto.lib || exit /b
if "%DC%" == "ldc2" (
echo LIB=%CD%\extern_deps>> %GITHUB_ENV%
) else (
:: https://issues.dlang.org/show_bug.cgi?id=22707
echo DFLAGS=-L/LIBPATH:%CD%\extern_deps>> %GITHUB_ENV%
:: DFLAGS ignored when building unittests with `--build=unittest-cov` => copy to root
xcopy extern_deps . || exit /b
)
echo KAL_EXT_LIB_WIN64=%CD%\extern_deps>> %GITHUB_ENV%
- name: dub build
run: dub build
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.dub
dub.selections.json
/extra.selections.json

libsymmetry-imap.*
symmetry-imap-test-default
/symmetry-imap-test-unittest*
example/imap-example

tags
Expand All @@ -12,3 +13,6 @@ replrc
SIL.log
SIL_user.log
history.txt

# coverage files
*.lst
6 changes: 6 additions & 0 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ configuration "plugin" {
dependency "pegged" version=">=0.0.0" optional=true
targetType "dynamicLibrary"
targetPath "plugin"
targetName "sil-plugin-imap"
versions "SIL_Plugin" "SIL" "MoveSanity"
lflags "/LIBPATH:$KAL_EXT_LIB_WIN64" platform="windows-x86_64"
}
configuration "unittest" {
# Windows: set KAL_EXT_LIB_WIN64 env var to dir containing `lib{ssl,crypto}.lib`
lflags "/LIBPATH:$KAL_EXT_LIB_WIN64" platform="windows-x86_64"
}
3 changes: 3 additions & 0 deletions example/dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ dependency "symmetry-imap" path="../"
subConfiguration "symmetry-imap" "default"
targetType "executable"
dependency "arsd-official:email" version="~>8.5"

# Windows: set KAL_EXT_LIB_WIN64 env var to dir containing `lib{ssl,crypto}.lib`
lflags "/LIBPATH:$KAL_EXT_LIB_WIN64" platform="windows-x86_64"
5 changes: 4 additions & 1 deletion test/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
},
"description": "Functional test application for IMAP.",
"license": "MIT",
"name": "imap-d-test"
"name": "imap-d-test",
"lflags-windows-x86_64": [
"/LIBPATH:$KAL_EXT_LIB_WIN64"
]
}

0 comments on commit eada5d1

Please sign in to comment.