<div dir="ltr">I was recently communicating with openwatcom matinainers; which just released a version 2.0 fork on sourceforge... but the issue was basically... if I have a shared library with no exports, it fails to build.<div>
<br></div><div>I used to use a method...(and this is how cmake does it)</div><div><br></div><div>wlink (...)  # build library</div><div>wlib (...) # build import library from wlink output</div><div><br></div><div>but doing it this way if the .dll has no exports, wlib results in an error, and faults the build.</div>
<div><br></div><div>I was informed that the correct way is to build the import library during the wlink step using 'option implib[=libname]'</div><div><br></div><div>I was able to successfully modify </div><div><br>
</div><div>./share/cmake-2.8/Modules/Platform/Windows-wcl386.cmake</div><div><br></div><div>** remove  at line 42</div><div><br></div><div><div>#set(CMAKE_C_CREATE_IMPORT_LIBRARY</div><div>#  "wlib -c -q -n -b <TARGET_IMPLIB> +'<TARGET_UNQUOTED>'")</div>
<div>#set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})</div></div><div>#</div><div><br></div><div>** modify line 69 (65 if 4 lines deleted)</div><div><div> "wlink ${CMAKE_START_TEMP_FILE} system nt_dll  ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact  file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")</div>
</div><div><br></div><div>to include "option implib=<TARGET_IMPLIB>"</div><div><br></div><div><div> "wlink ${CMAKE_START_TEMP_FILE} system nt_dll  ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option implib=<TARGET_IMPLIB> option caseexact  file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")</div>
</div><div><br></div><div><br></div><div>and then the next line...</div><div><br></div><div><div>set(CMAKE_CXX_CREATE_SHARED_LIBRARY</div><div>  ${CMAKE_CXX_CREATE_SHARED_MODULE}</div><div>  ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})</div>
</div><div><br></div><div>Includes a reference to the IMPORT_LIBRARY symbol removed before so that can be removed.</div><div><br></div><div><br></div><div><br></div><div>Please update this for the future </div></div>