[PlayStation] Enable JSC shell to run
authoryoshiaki.jitsukawa@sony.com <yoshiaki.jitsukawa@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 May 2020 05:55:53 +0000 (05:55 +0000)
committeryoshiaki.jitsukawa@sony.com <yoshiaki.jitsukawa@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 May 2020 05:55:53 +0000 (05:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=212294

Reviewed by Ross Kirsling.

.:

* Source/cmake/OptionsPlayStation.cmake:

Source/JavaScriptCore:

* shell/PlatformPlayStation.cmake:
Set working directory for Visual Studio
* shell/playstation/Initializer.cpp:
Load libJavaScriptCore as we now build it as SHARED.

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

ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/shell/PlatformPlayStation.cmake
Source/JavaScriptCore/shell/playstation/Initializer.cpp
Source/cmake/OptionsPlayStation.cmake

index 39f0e19..6e96aeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-05-22  Yoshiaki JITSUKAWA  <yoshiaki.jitsukawa@sony.com>
+
+        [PlayStation] Enable JSC shell to run
+        https://bugs.webkit.org/show_bug.cgi?id=212294
+
+        Reviewed by Ross Kirsling.
+
+        * Source/cmake/OptionsPlayStation.cmake:
+
 2020-05-21  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
 
         [PlayStation] Add minimal WKView API to enable TestWebKitAPI
index e831e7f..9fd1faa 100644 (file)
@@ -1,3 +1,15 @@
+2020-05-22  Yoshiaki JITSUKAWA  <yoshiaki.jitsukawa@sony.com>
+
+        [PlayStation] Enable JSC shell to run
+        https://bugs.webkit.org/show_bug.cgi?id=212294
+
+        Reviewed by Ross Kirsling.
+
+        * shell/PlatformPlayStation.cmake:
+        Set working directory for Visual Studio
+        * shell/playstation/Initializer.cpp:
+        Load libJavaScriptCore as we now build it as SHARED.
+
 2020-05-22  Alexey Shvayka  <shvaikalesh@gmail.com>
 
         Array.prototype.splice doesn't set "length" of returned object
index ab0096f..6e18ee3 100644 (file)
@@ -19,3 +19,8 @@ endif ()
 
 set(PLAYSTATION_jsc_PROCESS_NAME "JSCShell")
 set(PLAYSTATION_jsc_MAIN_THREAD_NAME "JSCShell")
+
+# Set the debugger working directory for Visual Studio
+if (${CMAKE_GENERATOR} MATCHES "Visual Studio")
+    set_target_properties(jsc PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+endif ()
index 8e87144..658e1a9 100644 (file)
 #include "config.h"
 #include <dlfcn.h>
 
+static void loadLibraryOrExit(const char* name)
+{
+    if (!dlopen(name, RTLD_NOW)) {
+        fprintf(stderr, "Failed to load %s.\n", name);
+        exit(EXIT_FAILURE);
+    }
+}
+
 __attribute__((constructor(101)))
 static void initializer(void)
 {
-    void* handle = dlopen("SystemServices", RTLD_NOW);
-    if (!handle)
-        exit(1);
-    handle = dlopen("Perf", RTLD_NOW);
-    if (!handle)
-        exit(1);
-    handle = dlopen("PosixWebKit", RTLD_NOW);
-    if (!handle)
-        exit(1);
+    loadLibraryOrExit("SystemServices");
+    loadLibraryOrExit("Perf");
+    loadLibraryOrExit("PosixWebKit");
+    loadLibraryOrExit("libJavaScriptCore");
 }
index 6ac8055..7313a8b 100644 (file)
@@ -232,6 +232,12 @@ macro(WEBKIT_EXECUTABLE _target)
             target_link_options(${_target} PRIVATE -Wl,--wrap=${WRAP})
         endforeach ()
     endif ()
+    add_custom_command(TARGET ${_target}
+        POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy_directory
+            ${WEBKIT_LIBRARIES_DIR}/tools/sce_sys/
+            $<TARGET_FILE_DIR:${_target}>/sce_sys/
+    )
 endmacro()
 
 function(PLAYSTATION_COPY_SHARED_LIBRARIES target_name)