Alexander Camek schrieb:
Hi Christian

That's not true - on windows with mingw you link against .a
And cmake also search for .a (and .dll.a) but *also* for .lib which is imho a bug. When I've an import lib for msvc - foo.lib and one for mingw - foo.a I get foo.a for mingw, but as soon as I remove foo.a I get foo.lib which is wrong.

Not really, i can also link with a .lib under mingw.
And if you can't link with .lib file under mingw, then it would be a mingw bug at all, because both are endings.
That's the point - you can't mix msvc and mingw libs. You can only mix them as long as you stay in plain old C mode!
> It should contain the
correct machine representation. It would iritate me if i could link under windows against a elf (linux libs mostly .a ended) and it will work correctly.

But that's not the topic here.

So if you look under your installation path, there under Modules and Platform. There is a file called Windows-gcc.cmake this will be used if you are using under Windows gcc.

There is the part:
IF(MINGW)
  SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
  SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a" ".lib")
ENDIF(MINGW)

So it first looks for a dll, then for dll.a, then for .a and after that .lib.

So it is not a bug, it is your thinking how it should behave.

It's a bug - because I don't know if foo.lib is a static import lib for a plain C or C++ dll

Christian

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to