MantisBT - CMake
View Issue Details
0016078CMakeCMakepublic2016-04-24 04:282016-06-10 14:21
Thomas Nilsson 
Brad King 
normalminoralways
closedfixed 
PCWindows10
CMake 3.3.2 
CMake 3.6CMake 3.6 
0016078: CMake on Cygwin with clang not creating expected dll.a
I'm building a shared library and an application using that lib on Cygwin. With GCC CMake creates a .dll.a to use when linking. Switching to clang I get

[ 34%] Built target xyz_shared
make[2]: *** No rule to make target 'src/libxyz_shared.dll.a', needed by 'xyz.exe'. Stop.
On Cygwin, use the attached CMakeLists.txt and see it produce 'cygxyz_shared.dll' and 'libxyz_shared.dll.a'.

Clear the build directory and do

  $ CC=clang cmake ..; make

and it will not create 'libxyz_shared.dll.a'.
As described in this Stackoverflow question (http://stackoverflow.com/questions/36294199 [^]) the culprit seems to be the lack of the flags '-Wl,--enable-auto-import' when using clang.
Clang, cygwin
txt CMakeLists.txt (132) 2016-04-24 04:28
https://public.kitware.com/Bug/file/5679/CMakeLists.txt
Issue History
2016-04-24 04:28Thomas NilssonNew Issue
2016-04-24 04:28Thomas NilssonFile Added: CMakeLists.txt
2016-04-24 16:56Thomas NilssonTag Attached: Clang
2016-04-24 16:56Thomas NilssonTag Attached: cygwin
2016-04-25 09:03Brad KingNote Added: 0040925
2016-04-25 09:03Brad KingAssigned To => Brad King
2016-04-25 09:03Brad KingStatusnew => resolved
2016-04-25 09:03Brad KingResolutionopen => fixed
2016-04-25 09:03Brad KingFixed in Version => CMake 3.6
2016-04-25 09:03Brad KingTarget Version => CMake 3.6
2016-06-10 14:21Kitware RobotNote Added: 0041184
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0040925)
Brad King   
2016-04-25 09:03   
I think this was fixed in post-3.5 development by this commit:

 Cygwin: Add support for Clang compiler
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=517cef8c [^]

(0041184)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.