From: Ken Dreyer Date: Tue, 13 Sep 2022 17:34:35 +0000 (-0400) Subject: cmake: set empty CMAKE_DL_LIBS on MinGW X-Git-Tag: v18.1.0~1096^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3eea1e1750fe163790416ca3f186def2087a1035;p=ceph.git 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 --- 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})