<div dir="ltr">Can you add a -L to the link line so that it looks in <span style="color:rgb(33,33,33)"><CMAKE_BINARY_DIR>/bin?</span></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 16, 2016 at 5:00 PM Marcos Pividori via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mpividori added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: lib/Fuzzer/test/CMakeLists.txt:218<br class="gmail_msg">
   "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")<br class="gmail_msg">
-set_target_properties(LLVMFuzzer-DSO1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY<br class="gmail_msg">
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")<br class="gmail_msg">
-set_target_properties(LLVMFuzzer-DSO2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY<br class="gmail_msg">
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")<br class="gmail_msg">
+if(MSVC)<br class="gmail_msg">
+  # Import libraries will be created in the bin directory.<br class="gmail_msg">
----------------<br class="gmail_msg">
zturner wrote:<br class="gmail_msg">
> kcc wrote:<br class="gmail_msg">
> > That's bad. Please try to find a way to avoid this.<br class="gmail_msg">
> I'm not sure I follow the logic here.  Without this patch, where do the .lib and .dll file end up, and is the problem occuring during link time or runtime?<br class="gmail_msg">
I tried to find a better solution, but didn't succeed.<br class="gmail_msg">
Without this patch, the .lib ends in: "<CMAKE_BINARY_DIR>/bin" (because the .dll is created there with the rule: CMAKE_CXX_CREATE_SHARED_LIBRARY).<br class="gmail_msg">
But cmake tries to find it in: "<CMAKE_BINARY_DIR>/lib"<br class="gmail_msg">
So the problem is at link time.<br class="gmail_msg">
<br class="gmail_msg">
With this patch, I let cmake knows that the .lib file is in "<CMAKE_BINARY_DIR>/bin".<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Repository:<br class="gmail_msg">
  rL LLVM<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D27870" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27870</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>