From ad0e43afe6e48a9189135429c183fbf00bf547ba Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Sat, 30 Dec 2017 16:14:14 +0100 Subject: [PATCH] Add dl to CMAKE_DL_LIBS on MINGW --- cmake-mingw-dl.patch | 16 ++++++++++++++++ cmake.spec | 9 ++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 cmake-mingw-dl.patch diff --git a/cmake-mingw-dl.patch b/cmake-mingw-dl.patch new file mode 100644 index 0000000..1f16d26 --- /dev/null +++ b/cmake-mingw-dl.patch @@ -0,0 +1,16 @@ +diff -rupN cmake-3.10.1/Modules/Platform/Windows-GNU.cmake cmake-3.10.1-new/Modules/Platform/Windows-GNU.cmake +--- cmake-3.10.1/Modules/Platform/Windows-GNU.cmake 2017-12-13 14:25:23.000000000 +0100 ++++ cmake-3.10.1-new/Modules/Platform/Windows-GNU.cmake 2017-12-30 15:32:03.253515499 +0100 +@@ -28,9 +28,11 @@ if(MINGW) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a" ".lib") + set(CMAKE_C_STANDARD_LIBRARIES_INIT "-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32") + set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") ++ set(CMAKE_DL_LIBS "dl") ++else() ++ set(CMAKE_DL_LIBS "") + endif() + +-set(CMAKE_DL_LIBS "") + set(CMAKE_LIBRARY_PATH_FLAG "-L") + set(CMAKE_LINK_LIBRARY_FLAG "-l") + set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough diff --git a/cmake.spec b/cmake.spec index d629c90..094ca20 100644 --- a/cmake.spec +++ b/cmake.spec @@ -66,7 +66,7 @@ Name: %{orig_name}%{?name_suffix} Version: %{major_version}.%{minor_version}.1 -Release: 7%{?relsuf}%{?dist} +Release: 8%{?relsuf}%{?dist} Summary: Cross-platform make system # most sources are BSD @@ -98,6 +98,10 @@ Patch101: %{name}-fedora-flag_release.patch # Patch to fix RISC-V support. Sent upstream 2017-12-30. Patch102: cmake-3.10.1-fix-riscv.patch +# Add dl to CMAKE_DL_LIBS on MINGW +# https://gitlab.kitware.com/cmake/cmake/issues/17600 +Patch103: cmake-mingw-dl.patch + # Patch for renaming on EPEL %if 0%{?name_suffix:1} Patch1: %{name}-rename.patch @@ -511,6 +515,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %changelog +* Tue Jan 02 2018 Sandro Mani - 3.10.1-8 +- Add dl to CMAKE_DL_LIBS on MINGW + * Sat Dec 30 2017 Richard W.M. Jones - 3.10.1-7 - Add small fix for RISC-V support.