Skip to content

Commit 653e75b

Browse files
Allow libs installed via vcpkg to be linked to by crates
The `vcpkg` crate for finding dependencies installed by vcpkg requires some extra configuration.
1 parent e26181a commit 653e75b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

windows/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@ SHELL ["powershell", "-Command"]
2121
ADD https://github.com/Microsoft/vcpkg/archive/master.zip C:\TEMP\vcpkg-master.zip
2222
RUN $ErrorActionPreference = 'Stop'; `
2323
Expand-Archive -Path C:\TEMP\vcpkg-master.zip -DestinationPath .; `
24+
rm C:\TEMP\vcpkg-master.zip `
2425
cd .\vcpkg-master; `
2526
.\bootstrap-vcpkg.bat; `
2627
.\vcpkg integrate install
2728

2829
# Install packages
30+
#
31+
# The `vcpkg` crate searches for libraries matching the target architecture
32+
# exactly. It won't use x86 libraries on a 64-bit system. Setting the default
33+
# triplet tells `vcpkg` to install 64-bit versions.
34+
ENV VCPKG_DEFAULT_TRIPLET=x64-windows
2935
COPY vc-packages.txt C:\
3036
RUN .\vcpkg-master\vcpkg install @(Get-Content C:\vc-packages.txt)
3137

38+
# Tell the `vcpkg` crate to generate dynamically linked executables
39+
ENV VCPKGRS_DYNAMIC=1
40+
3241
CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

0 commit comments

Comments
 (0)