Skip to content

Commit f5fac42

Browse files
pks-tgitster
authored andcommitted
meson: stop linking libcurl into all executables
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 propagating include directories as a libgit dependency and propagating the full curl dependency via `libgit_curl`. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dfc88bd commit f5fac42

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,9 @@ if curl.found()
927927
use_curl_for_imap_send = true
928928
endif
929929

930-
libgit_dependencies += curl
930+
# Most executables don't have to link against libcurl, but we still need its
931+
# include directories so that we can resolve LIBCURL_VERSION in "help.c".
932+
libgit_dependencies += curl.partial_dependency(includes: true)
931933
libgit_c_args += '-DCURL_DISABLE_TYPECHECK'
932934
build_options_config.set('NO_CURL', '')
933935
else
@@ -1666,7 +1668,7 @@ if get_option('curl').enabled()
16661668
'http.c',
16671669
'http-walker.c',
16681670
],
1669-
dependencies: [libgit_commonmain],
1671+
dependencies: [libgit_commonmain, curl],
16701672
)
16711673

16721674
test_dependencies += executable('git-remote-http',

0 commit comments

Comments
 (0)