Skip to content

Commit 958a5f5

Browse files
dennisamelinggitster
authored andcommitted
cmake(install): include vcpkg dlls
Our CMake configuration generates not only build definitions, but also install definitions: After building Git using `msbuild git.sln`, the built artifacts can be installed via `msbuild INSTALL.vcxproj`. To specify _where_ the files should be installed, the `-DCMAKE_INSTALL_PREFIX=<path>` option can be used when running CMake. However, this process would really only install the files that were just built. On Windows, we need more than that: We also need the `.dll` files of the dependencies (such as libcurl). The `vcpkg` ecosystem, which we use to obtain those dependencies, can be asked to install said `.dll` files really easily, so let's do that. This requires more than just the built `vcpkg` artifacts in the CI build definition; We now clone the `vcpkg` repository so that the relevant CMake scripts are available, in particular the ones related to defining the toolchain. Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e8772a7 commit 958a5f5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ jobs:
186186
## Unzip and remove the artifact
187187
unzip artifacts.zip
188188
rm artifacts.zip
189+
- name: initialize vcpkg
190+
uses: actions/checkout@v2
191+
with:
192+
repository: 'microsoft/vcpkg'
193+
path: 'compat/vcbuild/vcpkg'
189194
- name: download vcpkg artifacts
190195
shell: powershell
191196
run: |

contrib/buildsystems/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ if(WIN32)
5858

5959
# In the vcpkg edition, we need this to be able to link to libcurl
6060
set(CURL_NO_CURL_CMAKE ON)
61+
62+
# Copy the necessary vcpkg DLLs (like iconv) to the install dir
63+
set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
64+
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file")
6165
endif()
6266

6367
find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin")

0 commit comments

Comments
 (0)