Add dl to CMAKE_DL_LIBS on MINGW

This commit is contained in:
Sandro Mani 2017-12-30 16:14:14 +01:00
parent 0953dfa2a7
commit ad0e43afe6
2 changed files with 24 additions and 1 deletions

16
cmake-mingw-dl.patch Normal file
View File

@ -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

View File

@ -66,7 +66,7 @@
Name: %{orig_name}%{?name_suffix} Name: %{orig_name}%{?name_suffix}
Version: %{major_version}.%{minor_version}.1 Version: %{major_version}.%{minor_version}.1
Release: 7%{?relsuf}%{?dist} Release: 8%{?relsuf}%{?dist}
Summary: Cross-platform make system Summary: Cross-platform make system
# most sources are BSD # 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. # Patch to fix RISC-V support. Sent upstream 2017-12-30.
Patch102: cmake-3.10.1-fix-riscv.patch 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 # Patch for renaming on EPEL
%if 0%{?name_suffix:1} %if 0%{?name_suffix:1}
Patch1: %{name}-rename.patch Patch1: %{name}-rename.patch
@ -511,6 +515,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%changelog %changelog
* Tue Jan 02 2018 Sandro Mani <manisandro@gmail.com> - 3.10.1-8
- Add dl to CMAKE_DL_LIBS on MINGW
* Sat Dec 30 2017 Richard W.M. Jones <rjones@redhat.com> - 3.10.1-7 * Sat Dec 30 2017 Richard W.M. Jones <rjones@redhat.com> - 3.10.1-7
- Add small fix for RISC-V support. - Add small fix for RISC-V support.