Skip to content

Commit 5a69234

Browse files
pks-tgitster
authored andcommitted
meson: fix handling of '-Dcurl=auto'
The "curl" option controls whether or not a couple of features that depend on curl shall be included. Most importantly, these features include the HTTP remote helpers, which are rather quintessential for a well-functioning Git installation. So while the dependency can in theory be dropped, most users wouldn't consider the resulting installation to be fully functional. The "curl" option is defined as a feature, which means that it can be "enabled", "disabled" or "auto", which has the effect that the feature will be enabled if the dependency itself has been found. While most of the other features have "auto" as default value, the "curl" option is set to "enabled" by default due to it being so important. Consequently, autoconfiguration of Git will fail by default if the library cannot be found. There is a bug though with how we handle the option in case the user overrides the feature with `meson setup -Dcurl=auto`: while we will try to find the library in that case, we won't ever use it because we later on check for `get_option('curl').enabled()` when deciding whether or not we want to build dependent sources. But `enabled()` only returns true if the option has the value "enabled", for "auto" it will return false. Fix the issue by instead checking for `curl.found()`, which is only true if the library has been found. And as we only try to find the library when `get_option('curl')` returns "true" or "auto" this is exactly what we want. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 683c54c commit 5a69234

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ bin_wrappers += executable('scalar',
16861686
install_dir: get_option('libexecdir') / 'git-core',
16871687
)
16881688

1689-
if get_option('curl').enabled()
1689+
if curl.found()
16901690
libgit_curl = declare_dependency(
16911691
sources: [
16921692
'http.c',

0 commit comments

Comments
 (0)