Windows-GNU: Do not tell find_library to treat '.dll' as linkable

Modern software distributions always use a separate ".dll.a" or ".lib"
import library for linking.
This commit is contained in:
Brad King 2015-02-18 09:37:14 -05:00
parent 4fb9e847c0
commit a0f17fbe9c
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,8 @@
mingw-no-find_library-dll
-------------------------
* When building with GNU tools on Windows (MinGW tools), the
:command:`find_library` command will no longer consider
``.dll`` files to be linkable libraries. All dynamic link
libraries are expected to provide separate ``.dll.a`` or
``.lib`` import libraries.

View File

@ -35,7 +35,7 @@ endif()
if(MINGW)
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a" ".lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".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}")
endif()