From 3eea1e1750fe163790416ca3f186def2087a1035 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Tue, 13 Sep 2022 13:34:35 -0400 Subject: [PATCH] cmake: set empty CMAKE_DL_LIBS on MinGW Upstream CMake sets CMAKE_DL_LIBS to an empty value on MINGW, but the Fedora and RHEL packages override this and set "dl". Re-set it back to an empty value. We can revert this if https://bugzilla.redhat.com/2127529 is resolved for CMake in Fedora and RHEL. Signed-off-by: Ken Dreyer --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 549b18bcfdf..8d6add4666b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -249,6 +249,12 @@ if(COMPILER_SUPPORTS_DIAGNOSTICS_COLOR) "$<$:-fdiagnostics-color=${DIAGNOSTICS_COLOR}>") endif() +if(MINGW) + # Fedora and RHEL set CMAKE_DL_LIBS on MINGW, which we must un-set here. + # Details at https://bugzilla.redhat.com/show_bug.cgi?id=2127529 + set(CMAKE_DL_LIBS "") +endif() + set(EXTRALIBS ${CMAKE_DL_LIBS}) if(HAVE_POSIX_TIMERS) list(APPEND EXTRALIBS ${RT_LIBRARY}) -- 2.47.3