[Win] ImageDiff should use DLLLauncher
authorross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 22:13:23 +0000 (22:13 +0000)
committerross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 22:13:23 +0000 (22:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186927

ImageDiff should use DLLLauncher to find DLLs under WEBKIT_LIBRARIES, in the same way as DRT & TestWebKitAPI.

Reviewed by Per Arne Vollan.

* ImageDiff/CMakeLists.txt:
* ImageDiff/ImageDiff.cpp:
(dllLauncherEntryPoint):
* ImageDiff/PlatformWin.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233102 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/ImageDiff/CMakeLists.txt
Tools/ImageDiff/ImageDiff.cpp
Tools/ImageDiff/PlatformWin.cmake

index 4768bb7..816980f 100644 (file)
@@ -1,3 +1,17 @@
+2018-06-22  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [Win] ImageDiff should use DLLLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=186927
+
+        ImageDiff should use DLLLauncher to find DLLs under WEBKIT_LIBRARIES, in the same way as DRT & TestWebKitAPI.
+
+        Reviewed by Per Arne Vollan.
+
+        * ImageDiff/CMakeLists.txt:
+        * ImageDiff/ImageDiff.cpp:
+        (dllLauncherEntryPoint):
+        * ImageDiff/PlatformWin.cmake:
+
 2018-06-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>
 
         [style] Fix --git-index option for check-webkit-style command
index 2c1ec8e..9c58cc5 100644 (file)
@@ -17,3 +17,7 @@ include_directories(${IMAGE_DIFF_INCLUDE_DIRECTORIES})
 include_directories(SYSTEM ${IMAGE_DIFF_SYSTEM_INCLUDE_DIRECTORIES})
 add_executable(ImageDiff ${IMAGE_DIFF_SOURCES})
 target_link_libraries(ImageDiff ${IMAGE_DIFF_LIBRARIES})
+
+if (WIN32)
+    add_dependencies(ImageDiff ImageDiffLib)
+endif ()
index f8a983b..9849f6f 100644 (file)
@@ -37,6 +37,7 @@
 #ifdef _WIN32
 #include <fcntl.h>
 #include <io.h>
+#include <windows.h>
 #endif
 
 using namespace ImageDiff;
@@ -136,3 +137,10 @@ int main(int argc, const char* argv[])
 
     return EXIT_SUCCESS;
 }
+
+#ifdef _WIN32
+extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, const char* argv[])
+{
+    return main(argc, argv);
+}
+#endif
index 2b9a860..08d49f7 100644 (file)
@@ -1,5 +1,15 @@
 if (${WTF_PLATFORM_WIN_CAIRO})
+    add_definitions(-DWIN_CAIRO)
+
     include(Cairo.cmake)
 else ()
     include(PlatformMac.cmake)
 endif ()
+
+add_library(ImageDiffLib SHARED ${IMAGE_DIFF_SOURCES})
+target_link_libraries(ImageDiffLib ${IMAGE_DIFF_LIBRARIES})
+
+add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
+
+set(IMAGE_DIFF_SOURCES ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp)
+set(IMAGE_DIFF_LIBRARIES shlwapi)