Add Fuchsia support to build-jsc
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2018 01:04:54 +0000 (01:04 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2018 01:04:54 +0000 (01:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187086

Reviewed by Yusuke Suzuki.

.:

Add Fuchsia port to cmake build system. After this patch, the build
errors out due to a missing sysroot.

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

Tools:

Add Fuchsia port to webkitdirs.pm. This patch is sufficient to make
build-jsc kick off a cmake for Fuchsia.

* Scripts/webkitdirs.pm:
(determineSourceDir):
(argumentsForConfiguration):
(determineXcodeSDK):
(findMatchingArguments):
(determinePortName):
(isFuchsia):
(setupAppleWinEnv):
(wrapperPrefixIfNeeded):
(relaunchIOSSimulator):
(debugMiniBrowser):

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

CMakeLists.txt
ChangeLog
Source/cmake/OptionsFuchsia.cmake [new file with mode: 0644]
Tools/ChangeLog
Tools/Scripts/webkitdirs.pm

index 1903d6a..69fd5b3 100644 (file)
@@ -37,6 +37,7 @@ endif ()
 set(ALL_PORTS
     AppleWin
     Efl
+    Fuchsia
     GTK
     JSCOnly
     Mac
index de4c55c..7cfeea2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2018-06-27  Adam Barth  <abarth@webkit.org>
+
+        Add Fuchsia support to build-jsc
+        https://bugs.webkit.org/show_bug.cgi?id=187086
+
+        Reviewed by Yusuke Suzuki.
+
+        Add Fuchsia port to cmake build system. After this patch, the build
+        errors out due to a missing sysroot.
+
+        * CMakeLists.txt:
+        * Source/cmake/OptionsFuchsia.cmake: Added.
+
 2018-06-18  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed GTK+ gardening. Updating the WPT expectations by removing
diff --git a/Source/cmake/OptionsFuchsia.cmake b/Source/cmake/OptionsFuchsia.cmake
new file mode 100644 (file)
index 0000000..c4afac4
--- /dev/null
@@ -0,0 +1,29 @@
+set(PROJECT_VERSION_MAJOR 1)
+set(PROJECT_VERSION_MINOR 0)
+set(PROJECT_VERSION_MICRO 0)
+set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_MICRO})
+
+set(CMAKE_SYSTEM_NAME Fuchsia)
+
+if (WTF_CPU_ARM64)
+    set(triple aarch64-unknown-fuchsia)
+elseif (WTF_CPU_X86_64)
+    set(triple x86_64-unknown-fuchsia)
+else ()
+    message(FATAL_ERROR "Unknown ARCH '${CMAKE_SYSTEM_PROCESSOR}'")
+endif ()
+
+set(CMAKE_C_COMPILER_TARGET ${triple})
+set(CMAKE_CXX_COMPILER_TARGET ${triple})
+
+WEBKIT_OPTION_BEGIN()
+WEBKIT_OPTION_DEFINE(ENABLE_STATIC_JSC "Whether to build JavaScriptCore as a static library." PUBLIC OFF)
+WEBKIT_OPTION_END()
+
+set(ENABLE_WEBCORE OFF)
+set(ENABLE_WEBKIT_LEGACY OFF)
+set(ENABLE_WEBKIT OFF)
+set(ENABLE_API_TESTS OFF)
+
+SET_AND_EXPOSE_TO_BUILD(USE_GENERIC_EVENT_LOOP 1)
+SET_AND_EXPOSE_TO_BUILD(WTF_DEFAULT_EVENT_LOOP 0)
index 5c6c081..af3378c 100644 (file)
@@ -1,3 +1,25 @@
+2018-06-27  Adam Barth  <abarth@webkit.org>
+
+        Add Fuchsia support to build-jsc
+        https://bugs.webkit.org/show_bug.cgi?id=187086
+
+        Reviewed by Yusuke Suzuki.
+
+        Add Fuchsia port to webkitdirs.pm. This patch is sufficient to make
+        build-jsc kick off a cmake for Fuchsia.
+
+        * Scripts/webkitdirs.pm:
+        (determineSourceDir):
+        (argumentsForConfiguration):
+        (determineXcodeSDK):
+        (findMatchingArguments):
+        (determinePortName):
+        (isFuchsia):
+        (setupAppleWinEnv):
+        (wrapperPrefixIfNeeded):
+        (relaunchIOSSimulator):
+        (debugMiniBrowser):
+
 2018-06-27  Daniel Bates  <dabates@apple.com>
 
         style-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when processing security patch
index 909218a..ccd8022 100755 (executable)
@@ -104,6 +104,7 @@ BEGIN {
 # Ports
 use constant {
     AppleWin => "AppleWin",
+    Fuchsia  => "Fuchsia",
     GTK      => "GTK",
     iOS      => "iOS",
     tvOS     => "tvOS",
@@ -476,6 +477,7 @@ sub argumentsForConfiguration()
     push(@args, '--ios-simulator') if (defined $xcodeSDK && $xcodeSDK =~ /^iphonesimulator/);
     push(@args, '--32-bit') if ($architecture ne "x86_64" and !isWin64());
     push(@args, '--64-bit') if (isWin64());
+    push(@args, '--fuchsia') if isFuchsia();
     push(@args, '--gtk') if isGtk();
     push(@args, '--wpe') if isWPE();
     push(@args, '--jsc-only') if isJSCOnly();
@@ -1189,6 +1191,7 @@ sub determinePortName()
     return if defined $portName;
 
     my %argToPortName = (
+        fuchsia => Fuchsia,
         gtk => GTK,
         'jsc-only' => JSCOnly,
         wincairo => WinCairo,
@@ -1244,6 +1247,11 @@ sub portName()
     return $portName;
 }
 
+sub isFuchsia()
+{
+    return portName() eq Fuchsia;
+}
+
 sub isGtk()
 {
     return portName() eq GTK;
@@ -2023,7 +2031,7 @@ sub isCachedArgumentfileOutOfDate($@)
 
 sub wrapperPrefixIfNeeded()
 {
-    if (isAnyWindows() || isJSCOnly()) {
+    if (isAnyWindows() || isJSCOnly() || isFuchsia()) {
         return ();
     }
     if (isAppleCocoaWebKit()) {