[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
Sat Jan 21 18:39:16 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL292748: [libFuzzer] Fix test with shared libraries on Windows. (authored by mpividori).
Changed prior to commit:
https://reviews.llvm.org/D27870?vs=85210&id=85269#toc
Repository:
rL LLVM
https://reviews.llvm.org/D27870
Files:
llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
llvm/trunk/lib/Fuzzer/test/DSO1.cpp
llvm/trunk/lib/Fuzzer/test/DSO2.cpp
Index: llvm/trunk/lib/Fuzzer/test/DSO2.cpp
===================================================================
--- llvm/trunk/lib/Fuzzer/test/DSO2.cpp
+++ llvm/trunk/lib/Fuzzer/test/DSO2.cpp
@@ -2,7 +2,9 @@
// License. See LICENSE.TXT for details.
// Source code for a simple DSO.
-
+#ifdef _WIN32
+__declspec( dllexport )
+#endif
int DSO2(int a) {
if (a < 3598235)
return 0;
Index: llvm/trunk/lib/Fuzzer/test/DSO1.cpp
===================================================================
--- llvm/trunk/lib/Fuzzer/test/DSO1.cpp
+++ llvm/trunk/lib/Fuzzer/test/DSO1.cpp
@@ -2,7 +2,9 @@
// License. See LICENSE.TXT for details.
// Source code for a simple DSO.
-
+#ifdef _WIN32
+__declspec( dllexport )
+#endif
int DSO1(int a) {
if (a < 123456)
return 0;
Index: llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
===================================================================
--- llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
+++ llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
@@ -195,10 +195,20 @@
set_target_properties(LLVMFuzzer-DSOTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${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)
+ set_output_directory(LLVMFuzzer-DSO1
+ BINARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test"
+ LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
+ set_output_directory(LLVMFuzzer-DSO2
+ BINARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test"
+ LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
+else(MSVC)
+ set_output_directory(LLVMFuzzer-DSO1
+ LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+ set_output_directory(LLVMFuzzer-DSO2
+ LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+endif()
set(TestBinaries ${TestBinaries} LLVMFuzzer-DSOTest)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27870.85269.patch
Type: text/x-patch
Size: 1943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170122/78e61f95/attachment.bin>
More information about the llvm-commits
mailing list