Skip to content

AsynchDNS CURL Component requirement can erroneously fail #1205

@gregcotten

Description

@gregcotten

TL;DR
If you get the error CURL: Required feature AsynchDNS is not found while building this project, it is (probably) a false negative.


Apparently a fix was made for CURL component/feature detection starting in CMake 3.29 (something to do with pkgconfig parsing).

In my case, I'm targeting a RHEL8 distro, whose dnf info cmake shows 3.26.5 as the latest version.

If you're getting CURL: Required feature AsynchDNS is not found with libcurl-devel installed, curl-config --feature containing AsynchDNS (a feature added in 2003), you need to probably uninstall your package-installed cmake and install a later version available from the CMake GitHub.

I think the best fix for this would be to change

find_package(CURL REQUIRED COMPONENTS AsynchDNS)

to

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.29.0")
  find_package(CURL REQUIRED COMPONENTS AsynchDNS)
else()
  # due to an issue with certain versions of CMake, don't try to check for AsynchDNS. The runtime check will fail anyway...
  find_package(CURL REQUIRED)
endif()

It seems to be impossible to find a libcurl that doesn't have AsynchDNS enabled anyway...

Related issue (#838)
cc @supervacuus

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugsomething isn't working as it should
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions