From 24a78db1c3f0050af5b0b1b70f9c3cb165c80394 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 4 Jul 2024 20:25:39 +0200 Subject: [PATCH] cmake: fix resolv on FreeBSD (#1152) * ci/freebsd: use ubuntu-latest * resolv functions are provided by libc instead libresolv.so --- .github/workflows/freebsd.yml | 2 +- cmake/re-config.cmake | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 6e56cb400..26411337e 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 20 env: diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index 426a79db4..c45216800 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -55,7 +55,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") else() check_symbol_exists(res_ninit resolv.h HAVE_RESOLV) endif() -if(HAVE_RESOLV) +if(HAVE_RESOLV AND ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + list(APPEND RE_DEFINITIONS HAVE_RESOLV) + set(RESOLV_LIBRARY) # Provided by libc +elseif(HAVE_RESOLV) set(RESOLV_LIBRARY resolv) list(APPEND RE_DEFINITIONS HAVE_RESOLV) else()