[PATCH] D27870: [libFuzzer] Diff 25 - Fix test with shared libraries on Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 17:00:23 PST 2016


mpividori added inline comments.


================
Comment at: lib/Fuzzer/test/CMakeLists.txt:218
   "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
-set_target_properties(LLVMFuzzer-DSO1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
-set_target_properties(LLVMFuzzer-DSO2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+if(MSVC)
+  # Import libraries will be created in the bin directory.
----------------
zturner wrote:
> kcc wrote:
> > That's bad. Please try to find a way to avoid this. 
> 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?
I tried to find a better solution, but didn't succeed.
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).
But cmake tries to find it in: "<CMAKE_BINARY_DIR>/lib"
So the problem is at link time.

With this patch, I let cmake knows that the .lib file is in "<CMAKE_BINARY_DIR>/bin".


Repository:
  rL LLVM

https://reviews.llvm.org/D27870





More information about the llvm-commits mailing list