Skip to content

Commit dfc88bd

Browse files
pks-tgitster
authored andcommitted
meson: introduce libgit_curl dependency
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. Note that we don't include curl itself as a dependency. This is because we already pull it in transitively via the libgit dependency, which is unfortunate because libgit itself shouldn't actually link against curl in the first place. This will get fixed in the next commit. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ebb3536 commit dfc88bd

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

meson.build

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,39 +1661,41 @@ bin_wrappers += executable('scalar',
16611661
)
16621662

16631663
if get_option('curl').enabled()
1664-
curl_sources = [
1665-
'http.c',
1666-
'http-walker.c',
1667-
]
1668-
1669-
git_remote_http = executable('git-remote-http',
1670-
sources: curl_sources + 'remote-curl.c',
1664+
libgit_curl = declare_dependency(
1665+
sources: [
1666+
'http.c',
1667+
'http-walker.c',
1668+
],
16711669
dependencies: [libgit_commonmain],
1670+
)
1671+
1672+
test_dependencies += executable('git-remote-http',
1673+
sources: 'remote-curl.c',
1674+
dependencies: [libgit_curl],
16721675
install: true,
16731676
install_dir: get_option('libexecdir') / 'git-core',
16741677
)
1675-
test_dependencies += git_remote_http
16761678

16771679
test_dependencies += executable('git-http-fetch',
1678-
sources: curl_sources + 'http-fetch.c',
1679-
dependencies: [libgit_commonmain],
1680+
sources: 'http-fetch.c',
1681+
dependencies: [libgit_curl],
16801682
install: true,
16811683
install_dir: get_option('libexecdir') / 'git-core',
16821684
)
16831685

16841686
if expat.found()
16851687
test_dependencies += executable('git-http-push',
1686-
sources: curl_sources + 'http-push.c',
1687-
dependencies: [libgit_commonmain],
1688+
sources: 'http-push.c',
1689+
dependencies: [libgit_curl],
16881690
install: true,
16891691
install_dir: get_option('libexecdir') / 'git-core',
16901692
)
16911693
endif
16921694

16931695
foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ]
16941696
test_dependencies += executable(alias,
1695-
objects: git_remote_http.extract_all_objects(recursive: false),
1696-
dependencies: [libgit_commonmain],
1697+
sources: 'remote-curl.c',
1698+
dependencies: [libgit_curl],
16971699
)
16981700

16991701
install_symlink(alias + executable_suffix,
@@ -1703,14 +1705,9 @@ if get_option('curl').enabled()
17031705
endforeach
17041706
endif
17051707

1706-
imap_send_sources = ['imap-send.c']
1707-
if use_curl_for_imap_send
1708-
imap_send_sources += curl_sources
1709-
endif
1710-
17111708
test_dependencies += executable('git-imap-send',
1712-
sources: imap_send_sources,
1713-
dependencies: [libgit_commonmain],
1709+
sources: 'imap-send.c',
1710+
dependencies: [ use_curl_for_imap_send ? libgit_curl : libgit_commonmain ],
17141711
install: true,
17151712
install_dir: get_option('libexecdir') / 'git-core',
17161713
)

0 commit comments

Comments
 (0)