[FTW] Build JavaScriptCore
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jun 2019 16:54:10 +0000 (16:54 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jun 2019 16:54:10 +0000 (16:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199254

Reviewed by Brent Fulgham.

.:

Add the FTW [For the Win(dows)] port. FTW is OS(WINDOWS) + USE(DIRECT2D) +
USE(CURL). Its eventual goal is to be the one true Windows port but to avoid
breaking AppleWin and WinCairo its being split into its own port for the interim.

* CMakeLists.txt:
* Source/cmake/OptionsFTW.cmake: Added.

Source/JavaScriptCore:

* PlatformFTW.cmake: Added.

Source/WTF:

* wtf/PlatformFTW.cmake: Added.

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

CMakeLists.txt
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformFTW.cmake [new file with mode: 0644]
Source/WTF/ChangeLog
Source/WTF/wtf/PlatformFTW.cmake [new file with mode: 0644]
Source/cmake/OptionsFTW.cmake [new file with mode: 0644]

index ee0e67f..9b5f7a7 100644 (file)
@@ -37,6 +37,7 @@ endif ()
 set(ALL_PORTS
     AppleWin
     Efl
+    FTW
     GTK
     JSCOnly
     Mac
index 4e7ca70..1961751 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2019-06-27  Don Olmstead  <don.olmstead@sony.com>
+
+        [FTW] Build JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=199254
+
+        Reviewed by Brent Fulgham.
+
+        Add the FTW [For the Win(dows)] port. FTW is OS(WINDOWS) + USE(DIRECT2D) +
+        USE(CURL). Its eventual goal is to be the one true Windows port but to avoid
+        breaking AppleWin and WinCairo its being split into its own port for the interim.
+
+        * CMakeLists.txt:
+        * Source/cmake/OptionsFTW.cmake: Added.
+
 2019-06-27  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [CMake] Bump cmake_minimum_required version to 3.10
index c32afdb..ff0f77e 100644 (file)
@@ -1,3 +1,12 @@
+2019-06-27  Don Olmstead  <don.olmstead@sony.com>
+
+        [FTW] Build JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=199254
+
+        Reviewed by Brent Fulgham.
+
+        * PlatformFTW.cmake: Added.
+
 2019-06-27  Konstantin Tokarev  <annulen@yandex.ru>
 
         Use JSC_GLIB_API_ENABLED instead of USE(GLIB) as a compile-time check for GLib JSC API
diff --git a/Source/JavaScriptCore/PlatformFTW.cmake b/Source/JavaScriptCore/PlatformFTW.cmake
new file mode 100644 (file)
index 0000000..d2c7eb0
--- /dev/null
@@ -0,0 +1,63 @@
+list(APPEND JavaScriptCore_SOURCES
+    API/JSStringRefBSTR.cpp
+)
+
+list(APPEND JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
+    API/JSStringRefBSTR.h
+    API/JavaScriptCore.h
+)
+
+if (ENABLE_REMOTE_INSPECTOR)
+    list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
+        "${JAVASCRIPTCORE_DIR}/inspector/remote/socket"
+    )
+
+    list(APPEND JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
+        inspector/remote/RemoteAutomationTarget.h
+        inspector/remote/RemoteConnectionToTarget.h
+        inspector/remote/RemoteControllableTarget.h
+        inspector/remote/RemoteInspectionTarget.h
+        inspector/remote/RemoteInspector.h
+
+        inspector/remote/socket/RemoteInspectorConnectionClient.h
+        inspector/remote/socket/RemoteInspectorMessageParser.h
+        inspector/remote/socket/RemoteInspectorServer.h
+        inspector/remote/socket/RemoteInspectorSocket.h
+        inspector/remote/socket/RemoteInspectorSocketEndpoint.h
+    )
+
+    list(APPEND JavaScriptCore_SOURCES
+        API/JSRemoteInspector.cpp
+
+        inspector/remote/RemoteAutomationTarget.cpp
+        inspector/remote/RemoteConnectionToTarget.cpp
+        inspector/remote/RemoteControllableTarget.cpp
+        inspector/remote/RemoteInspectionTarget.cpp
+        inspector/remote/RemoteInspector.cpp
+
+        inspector/remote/socket/RemoteInspectorConnectionClient.cpp
+        inspector/remote/socket/RemoteInspectorMessageParser.cpp
+        inspector/remote/socket/RemoteInspectorServer.cpp
+        inspector/remote/socket/RemoteInspectorSocket.cpp
+        inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp
+
+        inspector/remote/socket/win/RemoteInspectorSocketWin.cpp
+    )
+
+    set(JavaScriptCore_LIBRARIES PUBLIC ${JavaScriptCore_LIBRARIES})
+    list(APPEND JavaScriptCore_LIBRARIES
+        PRIVATE ws2_32
+    )
+else ()
+    list(REMOVE_ITEM JavaScriptCore_SOURCES
+        inspector/JSGlobalObjectInspectorController.cpp
+    )
+endif ()
+
+file(COPY
+    "${JAVASCRIPTCORE_DIR}/JavaScriptCore.vcxproj/JavaScriptCore.resources"
+    DESTINATION
+    ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+)
+
+set(JavaScriptCore_OUTPUT_NAME JavaScriptCore${DEBUG_SUFFIX})
index 5519416..6edcec8 100644 (file)
@@ -1,3 +1,12 @@
+2019-06-27  Don Olmstead  <don.olmstead@sony.com>
+
+        [FTW] Build JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=199254
+
+        Reviewed by Brent Fulgham.
+
+        * wtf/PlatformFTW.cmake: Added.
+
 2019-06-27  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [CMake] Bump cmake_minimum_required version to 3.10
diff --git a/Source/WTF/wtf/PlatformFTW.cmake b/Source/WTF/wtf/PlatformFTW.cmake
new file mode 100644 (file)
index 0000000..84d5ed1
--- /dev/null
@@ -0,0 +1,36 @@
+list(APPEND WTF_PUBLIC_HEADERS
+    text/win/WCharStringExtras.h
+
+    win/DbgHelperWin.h
+    win/GDIObject.h
+    win/SoftLinking.h
+    win/Win32Handle.h
+)
+
+set(WTF_LIBRARIES PUBLIC ${WTF_LIBRARIES})
+list(APPEND WTF_LIBRARIES
+    PRIVATE Dbghelp # For symbol handling <dbghelp.h>
+    PRIVATE Shlwapi # For file system operations <shlwapi.h>
+    PUBLIC  Winmm   # For multimedia functions, also used in <timeapi.h>
+)
+
+list(APPEND WTF_SOURCES
+    text/win/StringWin.cpp
+    text/win/TextBreakIteratorInternalICUWin.cpp
+
+    win/CPUTimeWin.cpp
+    win/DbgHelperWin.cpp
+    win/FileSystemWin.cpp
+    win/LanguageWin.cpp
+    win/MainThreadWin.cpp
+    win/MemoryFootprintWin.cpp
+    win/MemoryPressureHandlerWin.cpp
+    win/OSAllocatorWin.cpp
+    win/PathWalker.cpp
+    win/RunLoopWin.cpp
+    win/ThreadSpecificWin.cpp
+    win/ThreadingWin.cpp
+    win/WorkQueueWin.cpp
+)
+
+set(WTF_OUTPUT_NAME WTF${DEBUG_SUFFIX})
diff --git a/Source/cmake/OptionsFTW.cmake b/Source/cmake/OptionsFTW.cmake
new file mode 100644 (file)
index 0000000..ab4841d
--- /dev/null
@@ -0,0 +1,97 @@
+if (CMAKE_VERSION VERSION_LESS 3.14)
+    message(FATAL_ERROR "CMake 3.14 or greater is required to compile WebKitFTW")
+endif ()
+
+if (MSVC_VERSION VERSION_LESS 1920)
+    message(FATAL_ERROR "Visual Studio 2019 is required to compile WebKitFTW")
+endif ()
+
+if (${WTF_CPU_X86})
+    message(FATAL_ERROR "WebKitFTW does not support 32-bit builds")
+endif ()
+
+set(PORT FTW)
+
+# Compilation options
+include(OptionsMSVC)
+
+add_definitions(-DWTF_PLATFORM_FTW=1)
+# Prevent min() and max() macros from being exposed
+add_definitions(-DNOMINMAX)
+# Use unicode
+add_definitions(-DUNICODE -D_UNICODE)
+# If <winsock2.h> is not included before <windows.h> redefinition errors occur
+# unless _WINSOCKAPI_ is defined before <windows.h> is included
+add_definitions(-D_WINSOCKAPI_=)
+
+# Setup library paths
+if (NOT WEBKIT_LIBRARIES_DIR)
+    if (DEFINED ENV{WEBKIT_LIBRARIES})
+        file(TO_CMAKE_PATH "$ENV{WEBKIT_LIBRARIES}" WEBKIT_LIBRARIES_DIR)
+    else ()
+        file(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}/WebKitLibraries/win" WEBKIT_LIBRARIES_DIR)
+    endif ()
+endif ()
+
+set(CMAKE_PREFIX_PATH ${WEBKIT_LIBRARIES_DIR})
+
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS OFF)
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin64)
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+
+WEBKIT_OPTION_BEGIN()
+
+# Enabled features
+
+# Experimental features
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REMOTE_INSPECTOR PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
+
+# Features to investigate
+#
+# Features that are temporarily turned off because an implementation is not
+# present at this time
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTL_JIT PRIVATE OFF)
+
+# No support planned
+
+# FIXME: Port bmalloc to Windows. https://bugs.webkit.org/show_bug.cgi?id=143310
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PRIVATE ON)
+
+WEBKIT_OPTION_END()
+
+find_package(ICU REQUIRED COMPONENTS data i18n uc)
+
+SET_AND_EXPOSE_TO_BUILD(USE_EXPORT_MACROS ON)
+SET_AND_EXPOSE_TO_BUILD(USE_INSPECTOR_SOCKET_SERVER ${ENABLE_REMOTE_INSPECTOR})
+
+set(WTF_LIBRARY_TYPE SHARED)
+set(JavaScriptCore_LIBRARY_TYPE SHARED)
+
+set(ENABLE_API_TESTS OFF)
+set(ENABLE_WEBCORE OFF)
+set(ENABLE_WEBKIT OFF)
+set(ENABLE_WEBKIT_LEGACY OFF)
+
+# Override headers directories
+set(WTF_FRAMEWORK_HEADERS_DIR ${CMAKE_BINARY_DIR}/WTF/Headers)
+set(JavaScriptCore_FRAMEWORK_HEADERS_DIR ${CMAKE_BINARY_DIR}/JavaScriptCore/Headers)
+set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR ${CMAKE_BINARY_DIR}/JavaScriptCore/PrivateHeaders)
+
+# Override derived sources directories
+set(WTF_DERIVED_SOURCES_DIR ${CMAKE_BINARY_DIR}/WTF/DerivedSources)
+set(JavaScriptCore_DERIVED_SOURCES_DIR ${CMAKE_BINARY_DIR}/JavaScriptCore/DerivedSources)
+
+# Override scripts directories
+set(WTF_SCRIPTS_DIR ${CMAKE_BINARY_DIR}/WTF/Scripts)
+set(JavaScriptCore_SCRIPTS_DIR ${CMAKE_BINARY_DIR}/JavaScriptCore/Scripts)