]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake(install): include vcpkg dlls
authorDennis Ameling <dennis@dennisameling.com>
Mon, 29 Mar 2021 12:41:45 +0000 (12:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Mar 2021 20:49:04 +0000 (13:49 -0700)
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 <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml
contrib/buildsystems/CMakeLists.txt

index 5f2f884b92f6bdb46cc38fb0af5876d4484753f5..73856bafc9debd7cfed82419706a4b023c69651b 100644 (file)
@@ -186,6 +186,11 @@ jobs:
         ## Unzip and remove the artifact
         unzip artifacts.zip
         rm artifacts.zip
+    - name: initialize vcpkg
+      uses: actions/checkout@v2
+      with:
+        repository: 'microsoft/vcpkg'
+        path: 'compat/vcbuild/vcpkg'
     - name: download vcpkg artifacts
       shell: powershell
       run: |
index 72e4c5abcd9babd1efd49c615adab0d5ad2125b4..6e0054a7951a0604eae17e6d83387ef1e72acc42 100644 (file)
@@ -58,6 +58,10 @@ if(WIN32)
 
        # In the vcpkg edition, we need this to be able to link to libcurl
        set(CURL_NO_CURL_CMAKE ON)
+
+       # Copy the necessary vcpkg DLLs (like iconv) to the install dir
+       set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
+       set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file")
 endif()
 
 find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin")