Changeset 245707 in webkit


Ignore:
Timestamp:
May 23, 2019 1:15:55 PM (5 years ago)
Author:
stephan.szabo@sony.com
Message:

[Win][CMake] Pass architecture to cmake via -A for both x64 and Win32
https://bugs.webkit.org/show_bug.cgi?id=198098

Reviewed by Don Olmstead.

With current CMake and Visual Studio 2019, the default
architecture will match the host, so we should make sure
to explicitly mention the architecture we want for 32-bit
builds as well for cases where we are on x64 and not in an
x64_x32 cross-build vcvars environment.

  • Scripts/webkitdirs.pm:

(getVisualStudioToolset): Get toolset name for cmake/msbuild
(getMSBuildPlatformArgument): Update to use getVisualStudioToolset
(getCMakeWindowsToolsetArgument): Get -A argument for cmake
based on toolset
(generateBuildSystemFromCMakeProject): Remove explicit -A x64
in 64-bit mode in favor of new getCMakeWindowsToolsetArgument.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r245698 r245707  
     12019-05-23  Stephan Szabo  <stephan.szabo@sony.com>
     2
     3        [Win][CMake] Pass architecture to cmake via -A for both x64 and Win32
     4        https://bugs.webkit.org/show_bug.cgi?id=198098
     5
     6        Reviewed by Don Olmstead.
     7
     8        With current CMake and Visual Studio 2019, the default
     9        architecture will match the host, so we should make sure
     10        to explicitly mention the architecture we want for 32-bit
     11        builds as well for cases where we are on x64 and not in an
     12        x64_x32 cross-build vcvars environment.
     13
     14        * Scripts/webkitdirs.pm:
     15        (getVisualStudioToolset): Get toolset name for cmake/msbuild
     16        (getMSBuildPlatformArgument): Update to use getVisualStudioToolset
     17        (getCMakeWindowsToolsetArgument): Get -A argument for cmake
     18        based on toolset
     19        (generateBuildSystemFromCMakeProject): Remove explicit -A x64
     20        in 64-bit mode in favor of new getCMakeWindowsToolsetArgument.
     21
    1222019-05-23  Youenn Fablet  <youenn@apple.com>
    223
  • trunk/Tools/Scripts/webkitdirs.pm

    r245127 r245707  
    18741874}
    18751875
    1876 sub getMSBuildPlatformArgument()
     1876sub getVisualStudioToolset()
    18771877{
    18781878    if (isPlayStation()) {
    18791879        return "";
    18801880    } elsif (isWin64()) {
    1881         return "/p:Platform=x64";
     1881        return "x64";
    18821882    } else {
    1883         return "/p:Platform=Win32";
    1884     }
     1883        return "Win32";
     1884    }
     1885}
     1886
     1887sub getMSBuildPlatformArgument()
     1888{
     1889    my $toolset = getVisualStudioToolset();
     1890    if (defined($toolset) && length($toolset)) {
     1891        return "/p:Platform=$toolset";
     1892    }
     1893    return "";
     1894}
     1895
     1896sub getCMakeWindowsToolsetArgument()
     1897{
     1898    my $toolset = getVisualStudioToolset();
     1899    if (defined($toolset) && length($toolset)) {
     1900        return "-A $toolset";
     1901    }
     1902    return "";
    18851903}
    18861904
     
    21982216        push @args, "-DUSE_THIN_ARCHIVES=OFF" if isPlayStation();
    21992217    } else {
    2200         if (isAnyWindows() && isWin64()) {
    2201             push @args, '-A x64';
     2218        if (isAnyWindows()) {
     2219            push @args, getCMakeWindowsToolsetArgument();
    22022220        }
    22032221        if ((isAnyWindows() || isPlayStation()) && defined $ENV{VisualStudioVersion}) {
Note: See TracChangeset for help on using the changeset viewer.