[PATCH 05/11] meson: introduce `libgit_curl` dependency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We've got a set of common source files that we use for those executables
that link against libcurl. The setup is somewhat repetitive though.
Simplify it by declaring a `libgit_curl` dependency that bundles all of
it together.

Signed-off-by: Patrick Steinhardt <ps@xxxxxx>
---
 meson.build | 41 ++++++++++++++++++-----------------------
 1 file changed, 18 insertions(+), 23 deletions(-)

diff --git a/meson.build b/meson.build
index 6f62728117..e022235815 100644
--- a/meson.build
+++ b/meson.build
@@ -1623,30 +1623,32 @@ bin_wrappers += executable('scalar',
 )
 
 if get_option('curl').enabled()
-  curl_sources = [
-    'http.c',
-    'http-walker.c',
-  ]
-
-  git_remote_http = executable('git-remote-http',
-    sources: curl_sources + 'remote-curl.c',
+  libgit_curl = declare_dependency(
+    sources: [
+      'http.c',
+      'http-walker.c',
+    ],
     dependencies: [libgit_commonmain, curl],
+  )
+
+  test_dependencies += executable('git-remote-http',
+    sources: 'remote-curl.c',
+    dependencies: libgit_curl,
     install: true,
     install_dir: get_option('libexecdir') / 'git-core',
   )
-  test_dependencies += git_remote_http
 
   test_dependencies += executable('git-http-fetch',
-    sources: curl_sources + 'http-fetch.c',
-    dependencies: [libgit_commonmain, curl],
+    sources: 'http-fetch.c',
+    dependencies: libgit_curl,
     install: true,
     install_dir: get_option('libexecdir') / 'git-core',
   )
 
   if expat.found()
     test_dependencies += executable('git-http-push',
-      sources: curl_sources + 'http-push.c',
-      dependencies: [libgit_commonmain, curl],
+      sources: 'http-push.c',
+      dependencies: libgit_curl,
       install: true,
       install_dir: get_option('libexecdir') / 'git-core',
     )
@@ -1654,8 +1656,8 @@ 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, curl],
+      sources: 'remote-curl.c',
+      dependencies: libgit_curl,
     )
 
     install_symlink(alias + executable_suffix,
@@ -1665,16 +1667,9 @@ if get_option('curl').enabled()
   endforeach
 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: imap_send_dependencies,
+  sources: 'imap-send.c',
+  dependencies: use_curl_for_imap_send ? [libgit_curl] : [libgit_commonmain],
   install: true,
   install_dir: get_option('libexecdir') / 'git-core',
 )

-- 
2.48.1.362.g079036d154.dirty





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux