diff mbox series

[04/11] meson: stop linking libcurl into all executables

Message ID 20250129-b4-pks-meson-improvements-v1-4-ab709f0be12c@pks.im (mailing list archive)
State Superseded
Headers show
Series meson: cleanups, improvements, smallish fixes | expand

Commit Message

Patrick Steinhardt Jan. 29, 2025, 7:11 a.m. UTC
We set up libcurl via the `libgit_dependencies` variable, which gets
propagated into every user of the `libgit` dependency. This is not
necessary though, as most of our executables aren't even supposed to
link against libcurl.

Fix this by only linking against libcurl as required.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 meson.build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 82b6e62029..6f62728117 100644
--- a/meson.build
+++ b/meson.build
@@ -911,7 +911,6 @@  if curl.found()
     use_curl_for_imap_send = true
   endif
 
-  libgit_dependencies += curl
   libgit_c_args += '-DCURL_DISABLE_TYPECHECK'
   build_options_config.set('NO_CURL', '')
 else
@@ -1631,7 +1630,7 @@  if get_option('curl').enabled()
 
   git_remote_http = executable('git-remote-http',
     sources: curl_sources + 'remote-curl.c',
-    dependencies: [libgit_commonmain],
+    dependencies: [libgit_commonmain, curl],
     install: true,
     install_dir: get_option('libexecdir') / 'git-core',
   )
@@ -1639,7 +1638,7 @@  if get_option('curl').enabled()
 
   test_dependencies += executable('git-http-fetch',
     sources: curl_sources + 'http-fetch.c',
-    dependencies: [libgit_commonmain],
+    dependencies: [libgit_commonmain, curl],
     install: true,
     install_dir: get_option('libexecdir') / 'git-core',
   )
@@ -1647,7 +1646,7 @@  if get_option('curl').enabled()
   if expat.found()
     test_dependencies += executable('git-http-push',
       sources: curl_sources + 'http-push.c',
-      dependencies: [libgit_commonmain],
+      dependencies: [libgit_commonmain, curl],
       install: true,
       install_dir: get_option('libexecdir') / 'git-core',
     )
@@ -1656,7 +1655,7 @@  if get_option('curl').enabled()
   foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ]
     test_dependencies += executable(alias,
       objects: git_remote_http.extract_all_objects(recursive: false),
-      dependencies: [libgit],
+      dependencies: [libgit, curl],
     )
 
     install_symlink(alias + executable_suffix,
@@ -1667,13 +1666,15 @@  if get_option('curl').enabled()
 endif
 
 imap_send_sources = ['imap-send.c']
+imap_send_dependencies = [libgit_commonmain]
 if use_curl_for_imap_send
   imap_send_sources += curl_sources
+  imap_send_dependencies += curl
 endif
 
 test_dependencies += executable('git-imap-send',
   sources: imap_send_sources,
-  dependencies: [libgit_commonmain],
+  dependencies: imap_send_dependencies,
   install: true,
   install_dir: get_option('libexecdir') / 'git-core',
 )