git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Dennis Ameling via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Dennis Ameling" <dennis@dennisameling.com>
Subject: [PATCH v2 4/4] cmake(install): include vcpkg dlls
Date: Mon, 29 Mar 2021 12:41:45 +0000	[thread overview]
Message-ID: <f020cb517dfc48e2619815e09110d4044eed1ebe.1617021705.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.887.v2.git.1617021705.gitgitgadget@gmail.com>

From: Dennis Ameling <dennis@dennisameling.com>

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>
---
 .github/workflows/main.yml          | 5 +++++
 contrib/buildsystems/CMakeLists.txt | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f6885e88ee6b..c13afe2bf058 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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: |
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 3b94b5f62109..485c7662dc58 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -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")
-- 
gitgitgadget

      parent reply	other threads:[~2021-03-29 12:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 23:06 [PATCH 0/4] cmake: learn to optionally skip linking dashed built-ins Johannes Schindelin via GitGitGadget
2021-03-27 23:06 ` [PATCH 1/4] cmake: support SKIP_DASHED_BUILT_INS Johannes Schindelin via GitGitGadget
2021-03-27 23:06 ` [PATCH 2/4] cmake(install): fix double .exe suffixes Dennis Ameling via GitGitGadget
2021-03-27 23:06 ` [PATCH 3/4] cmake: add a preparatory work-around to accommodate `vcpkg` Johannes Schindelin via GitGitGadget
2021-03-28  3:19   ` Đoàn Trần Công Danh
2021-03-29 13:36     ` Johannes Schindelin
2021-03-27 23:06 ` [PATCH 4/4] cmake(install): include vcpkg dlls Dennis Ameling via GitGitGadget
2021-03-29 12:41 ` [PATCH v2 0/4] cmake: learn to optionally skip linking dashed built-ins Johannes Schindelin via GitGitGadget
2021-03-29 12:41   ` [PATCH v2 1/4] cmake: support SKIP_DASHED_BUILT_INS Johannes Schindelin via GitGitGadget
2021-03-29 12:41   ` [PATCH v2 2/4] cmake(install): fix double .exe suffixes Dennis Ameling via GitGitGadget
2021-03-29 12:41   ` [PATCH v2 3/4] cmake: add a preparatory work-around to accommodate `vcpkg` Johannes Schindelin via GitGitGadget
2021-03-29 12:41   ` Dennis Ameling via GitGitGadget [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f020cb517dfc48e2619815e09110d4044eed1ebe.1617021705.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=dennis@dennisameling.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).