Changeset 195742 in webkit


Ignore:
Timestamp:
Jan 28, 2016 9:18:38 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[webkitdirs] Clarify logic behind is{PortName} functions.
https://bugs.webkit.org/show_bug.cgi?id=153554

Patch by Konstantin Tokarev <Konstantin Tokarev> on 2016-01-28
Reviewed by Darin Adler.

  • Scripts/webkitdirs.pm:

(determinePortName): Added new function which decides which port are
we building based on command line switches and platform defaults.
(portName): Added getter for determined $portName.
(isEfl): Modified to use portName().
(isGtk): Ditto.
(isWinCairo): Ditto.
(isAppleMacWebKit): Ditto.
(isAppleWinWebKit): Ditto.
(isIOSWebKit): Ditto.
(cmakeBasedPortName): Code replaced with portName() call.
(determineIsEfl): Deleted.
(determineIsGtk): Deleted.
(determineIsWinCairo): Deleted.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r195737 r195742  
     12016-01-28  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        [webkitdirs] Clarify logic behind is{PortName} functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=153554
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/webkitdirs.pm:
     9        (determinePortName): Added new function which decides which port are
     10        we building based on command line switches and platform defaults.
     11        (portName): Added getter for determined $portName.
     12        (isEfl): Modified to use portName().
     13        (isGtk): Ditto.
     14        (isWinCairo): Ditto.
     15        (isAppleMacWebKit): Ditto.
     16        (isAppleWinWebKit): Ditto.
     17        (isIOSWebKit): Ditto.
     18        (cmakeBasedPortName): Code replaced with portName() call.
     19        (determineIsEfl): Deleted.
     20        (determineIsGtk): Deleted.
     21        (determineIsWinCairo): Deleted.
     22
    1232016-01-28  Konstantin Tokarev  <annulen@yandex.ru>
    224
  • trunk/Tools/Scripts/webkitdirs.pm

    r195737 r195742  
    9595}
    9696
     97# Ports
     98use constant {
     99    AppleWin => "AppleWin",
     100    GTK      => "GTK",
     101    Efl      => "Efl",
     102    iOS      => "iOS",
     103    Mac      => "Mac",
     104    WinCairo => "WinCairo"
     105};
     106
    97107use constant USE_OPEN_COMMAND => 1; # Used in runMacWebKitApp().
    98108use constant INCLUDE_OPTIONS_FOR_DEBUGGING => 1;
     
    125135my $generateDsym;
    126136my $isCMakeBuild;
    127 my $isGtk;
    128 my $isWinCairo;
    129137my $isWin64;
    130 my $isEfl;
    131138my $isInspectorFrontend;
     139my $portName;
    132140my $shouldTargetWebProcess;
    133141my $shouldUseXPCServiceForWebProcess;
     
    10251033}
    10261034
    1027 sub determineIsEfl()
    1028 {
    1029     return if defined($isEfl);
    1030     $isEfl = checkForArgumentAndRemoveFromARGV("--efl");
     1035sub determinePortName()
     1036{
     1037    return if defined $portName;
     1038
     1039    my %argToPortName = (
     1040        efl => Efl,
     1041        gtk => GTK,
     1042        wincairo => WinCairo
     1043    );
     1044
     1045    for my $arg (sort keys %argToPortName) {
     1046        if (checkForArgumentAndRemoveFromARGV("--$arg")) {
     1047            die "Argument '--$arg' conflicts with selected port '$portName'"
     1048                if defined $portName;
     1049
     1050            $portName = $argToPortName{$arg};
     1051        }
     1052    }
     1053
     1054    return if defined $portName;
     1055
     1056    # Port was not selected via command line, use appropriate default value
     1057
     1058    if (isAnyWindows()) {
     1059        $portName = AppleWin;
     1060    } elsif (isDarwin()) {
     1061        determineXcodeSDK();
     1062        if (willUseIOSDeviceSDK() || willUseIOSSimulatorSDK()) {
     1063            $portName = iOS;
     1064        } else {
     1065            $portName = Mac;
     1066        }
     1067    } else {
     1068        die "Please choose which WebKit port to build";
     1069    }
     1070}
     1071
     1072sub portName()
     1073{
     1074    determinePortName();
     1075    return $portName;
    10311076}
    10321077
    10331078sub isEfl()
    10341079{
    1035     determineIsEfl();
    1036     return $isEfl;
    1037 }
    1038 
    1039 sub determineIsGtk()
    1040 {
    1041     return if defined($isGtk);
    1042     $isGtk = checkForArgumentAndRemoveFromARGV("--gtk");
     1080    return portName() eq Efl;
    10431081}
    10441082
    10451083sub isGtk()
    10461084{
    1047     determineIsGtk();
    1048     return $isGtk;
     1085    return portName() eq GTK;
    10491086}
    10501087
     
    10621099sub isWinCairo()
    10631100{
    1064     determineIsWinCairo();
    1065     return $isWinCairo;
    1066 }
    1067 
    1068 sub determineIsWinCairo()
    1069 {
    1070     return if defined($isWinCairo);
    1071     $isWinCairo = checkForArgumentAndRemoveFromARGV("--wincairo");
     1101    return portName() eq WinCairo;
    10721102}
    10731103
     
    11921222sub isAppleMacWebKit()
    11931223{
    1194     return isDarwin() && !isGtk();
     1224    return (portName() eq Mac) || isIOSWebKit();
    11951225}
    11961226
    11971227sub isAppleWinWebKit()
    11981228{
    1199     return (isCygwin() || isWindows()) && !isWinCairo() && !isGtk();
     1229    return portName() eq AppleWin;
    12001230}
    12011231
     
    12601290sub isIOSWebKit()
    12611291{
    1262     determineXcodeSDK();
    1263     return isAppleMacWebKit() && (willUseIOSDeviceSDK() || willUseIOSSimulatorSDK());
     1292    return portName() eq iOS;
    12641293}
    12651294
     
    20622091sub cmakeBasedPortName()
    20632092{
    2064     return "Efl" if isEfl();
    2065     return "GTK" if isGtk();
    2066     return "Mac" if isAppleMacWebKit();
    2067     return "WinCairo" if isWinCairo();
    2068     return "AppleWin" if isAppleWinWebKit();
    2069     return "";
     2093    return portName();
    20702094}
    20712095
Note: See TracChangeset for help on using the changeset viewer.