Skip to content
Permalink
Browse files
Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-12-05
Reviewed by Per Arne Vollan.

.:

* Source/cmake/OptionsMSVC.cmake:

Source/JavaScriptCore:

* JavaScriptCore.vcxproj/JavaScriptCore.proj:

Source/WebCore:

Only changes proj file to update generator

* WebCore.vcxproj/WebCore.proj:

Source/WebKitLegacy:

* WebKitLegacy.vcxproj/WebKitLegacy.proj:

Source/WTF:

* WTF.vcxproj/WTF.proj:
* wtf/Compiler.h:

Tools:

* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(visualStudioInstallDir):
(visualStudioInstallDirFallback):
(msBuildInstallDir):
(setupAppleWinEnv):
(setupCygwinEnv):
(generateBuildSystemFromCMakeProject):
(pickLegacyVisualStudioInstallation): Deleted.
(visualStudioInstallDirLegacy): Deleted.
(visualStudioVersion): Deleted.
(visualStudioVersionFromInstallDir): Deleted.

Canonical link: https://commits.webkit.org/196391@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
foopoiuyt authored and webkit-commit-queue committed Dec 6, 2017
1 parent 1a54b34 commit 2897669745078269e0749c2b8747cd1b75499208
@@ -1,3 +1,12 @@
2017-12-05 Stephan Szabo <stephan.szabo@sony.com>

Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Reviewed by Per Arne Vollan.

* Source/cmake/OptionsMSVC.cmake:

2017-12-01 Konstantin Tokarev <annulen@yandex.ru>

[cmake] Make description of ENABLE_DRAG_SUPPORT more informative
@@ -1,3 +1,12 @@
2017-12-05 Stephan Szabo <stephan.szabo@sony.com>

Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Reviewed by Per Arne Vollan.

* JavaScriptCore.vcxproj/JavaScriptCore.proj:

2017-12-05 JF Bastien <jfbastien@apple.com>

WebAssembly: don't eagerly checksum
@@ -54,9 +54,9 @@
<Target Name="Build" AfterTargets="PreBuild">
<Message Text="Building $(CONFIGURATION) Solution" />
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 14 2015&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 14 2015 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
</Target>

@@ -1,3 +1,13 @@
2017-12-05 Stephan Szabo <stephan.szabo@sony.com>

Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Reviewed by Per Arne Vollan.

* WTF.vcxproj/WTF.proj:
* wtf/Compiler.h:

2017-12-05 Andy Estes <aestes@apple.com>

[Darwin] Simplify use of TargetConditionals
@@ -46,9 +46,9 @@
<Target Name="Build" AfterTargets="PreBuild">
<Message Text="Building $(CONFIGURATION) Solution" />
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 14 2015&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 14 2015 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
</Target>

@@ -130,8 +130,8 @@
#define WTF_COMPILER_MSVC 1
#define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS 1

#if _MSC_VER < 1900
#error "Please use a newer version of Visual Studio. WebKit requires VS2015 or newer to compile."
#if _MSC_VER < 1910
#error "Please use a newer version of Visual Studio. WebKit requires VS2017 or newer to compile."
#endif

#endif
@@ -1,3 +1,14 @@
2017-12-05 Stephan Szabo <stephan.szabo@sony.com>

Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Reviewed by Per Arne Vollan.

Only changes proj file to update generator

* WebCore.vcxproj/WebCore.proj:

2017-12-05 Brent Fulgham <bfulgham@apple.com>

Limit user agent versioning to an upper bound
@@ -54,9 +54,9 @@
<Target Name="Build" AfterTargets="PreBuild">
<Message Text="Building $(CONFIGURATION) Solution" />
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 14 2015&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 14 2015 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
</Target>

@@ -1,3 +1,12 @@
2017-12-05 Stephan Szabo <stephan.szabo@sony.com>

Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Reviewed by Per Arne Vollan.

* WebKitLegacy.vcxproj/WebKitLegacy.proj:

2017-11-27 Don Olmstead <don.olmstead@sony.com>

[CMake][Win] Conditionally select DLL CRT or static CRT
@@ -54,9 +54,9 @@
<Target Name="Build" AfterTargets="PreBuild">
<Message Text="Building $(CONFIGURATION) Solution" />
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 14 2015&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 14 2015 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
</Target>

@@ -97,10 +97,11 @@ string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_EXE_LINKER_FLAGS
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${replace_CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO")

if (COMPILER_IS_CLANG_CL)
# FIXME: We need to set the msc-version above the one it defaults to
# when using clang-cl with VS2015. This might be unnecessary when moving to
# VS2017 as part of https://bugs.webkit.org/show_bug.cgi?id=172412
add_compile_options(-fmsc-version=190023918)
# FIXME: The clang-cl visual studio integration seemed to set
# this to 1900 explicitly even when building in VS2017 with the
# newest toolset option, but we want to be versioned to match
# VS2017.
add_compile_options(-fmsc-version=1911)

# FIXME: Building with clang-cl seemed to fail with 128 bit int support
set(HAVE_INT128_T OFF)
@@ -1,3 +1,23 @@
2017-12-05 Stephan Szabo <stephan.szabo@sony.com>

Switch windows build to Visual Studio 2017
https://bugs.webkit.org/show_bug.cgi?id=172412

Reviewed by Per Arne Vollan.

* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(visualStudioInstallDir):
(visualStudioInstallDirFallback):
(msBuildInstallDir):
(setupAppleWinEnv):
(setupCygwinEnv):
(generateBuildSystemFromCMakeProject):
(pickLegacyVisualStudioInstallation): Deleted.
(visualStudioInstallDirLegacy): Deleted.
(visualStudioVersion): Deleted.
(visualStudioVersionFromInstallDir): Deleted.

2017-12-05 Alex Christensen <achristensen@webkit.org>

Fix crash when loading a file URL that does not have a fileSystemPath representation
@@ -288,7 +288,7 @@ if (isAppleWinWebKit() || isWinCairo()) {

chdirWebKit();
if (exitStatus(generateBuildSystemFromCMakeProject($prefixPath, @cmakeArgs))) {
die "Run \"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat\" before build-webkit when using ninja";
die "Run Visual Studio 2017 installation vcvars.bat before build-webkit when using ninja";
}

exit 0 if isGenerateProjectOnly();
@@ -161,7 +161,6 @@ my $windowsSourceDir;
my $winVersion;
my $willUseVCExpressWhenBuilding = 0;
my $vsWhereFoundInstallation;
my $vsWhereLegacyInstallation;

# Defined in VCSUtils.
sub exitStatus($);
@@ -634,37 +633,6 @@ sub pickCurrentVisualStudioInstallation
return undef;
}

sub pickLegacyVisualStudioInstallation
{
return $vsWhereLegacyInstallation if defined $vsWhereLegacyInstallation;

requireModulesForVSWhere();
determineSourceDir();

my $vsWhereOut = `$sourceDir/WebKitLibraries/win/tools/vswhere -nologo -legacy -format json`;
my $installations_all = [];
eval {
$installations_all = JSON::PP::decode_json(Encode::encode('UTF-8' => Encode::decode(console_in => $vsWhereOut)));
};
print "Error getting Visual Studio Legacy Location: $@\n" if $@;
undef $@;

# It's possible that a non-legacy installation without msbuild
# would not be found by the latest, but would be found by this
# vswhere call, and we want to skip those, so check for versions
# with an installation version before 15.0.
my @installations = grep { $_->{installationVersion} < 15 } @$installations_all;

# We don't get much information that would let us choose between
# legacy installations, so we'll take the first.
if (scalar @installations) {
my $installation = $installations[0];
$vsWhereLegacyInstallation = $installation;
return $installation;
}
return undef;
}

sub visualStudioInstallDir
{
return $vsInstallDir if defined $vsInstallDir;
@@ -674,12 +642,8 @@ sub visualStudioInstallDir
$vsInstallDir =~ s|[\\/]$||;
} else {
$vsInstallDir = visualStudioInstallDirVSWhere();
if (not -e $vsInstallDir) {
$vsInstallDir = visualStudioInstallDirLegacy();
}
if (not -e $vsInstallDir) {
$vsInstallDir = visualStudioInstallDirFallback();
print "Fallback $vsInstallDir\n";
}
}
chomp($vsInstallDir = `cygpath "$vsInstallDir"`) if isCygwin();
@@ -697,15 +661,6 @@ sub visualStudioInstallDirVSWhere
return undef;
}

sub visualStudioInstallDirLegacy
{
pickLegacyVisualStudioInstallation();
if (defined($vsWhereLegacyInstallation)) {
return $vsWhereLegacyInstallation->{installationPath};
}
return undef;
}

sub visualStudioInstallDirFallback
{
foreach my $productType ((
@@ -721,58 +676,23 @@ sub visualStudioInstallDirFallback
return $installdir;
}
}
return File::Spec->catdir(programFilesPathX86(), "Microsoft Visual Studio 14.0");
return undef;
}

sub msBuildInstallDir
{
return $msBuildInstallDir if defined $msBuildInstallDir;

my $version = visualStudioVersion();
if ($version >= 15.0) {
my $installDir = visualStudioInstallDir();
$msBuildInstallDir = File::Spec->catdir($installDir,
"MSBuild", $version, "bin");
} else {
$msBuildInstallDir = File::Spec->catdir(programFilesPathX86(),
"MSBuild", "14.0", "Bin")
}
my $installDir = visualStudioInstallDir();
$msBuildInstallDir = File::Spec->catdir($installDir,
"MSBuild", "15.0", "bin");

chomp($msBuildInstallDir = `cygpath "$msBuildInstallDir"`) if isCygwin();

print "Using MSBuild: $msBuildInstallDir\n";
return $msBuildInstallDir;
}

sub visualStudioVersion
{
return $vsVersion if defined $vsVersion;

my $installDir = visualStudioInstallDir();
$vsVersion = visualStudioVersionFromInstallDir($installDir);

print "Using Visual Studio $vsVersion\n";
return $vsVersion;
}

sub visualStudioVersionFromInstallDir
{
my ($dir) = @_;
my $version;

if ($dir =~ m|Microsoft Visual Studio[/\\]2017|) {
$version = "15.0";
}

if (!defined($version)) {
if ($dir =~ /Microsoft Visual Studio ([0-9]+\.[0-9]*)/) {
$version = $1;
}
}

return $version;
}

sub determineConfigurationForVisualStudio
{
return if defined $configurationForVisualStudio;
@@ -1858,13 +1778,13 @@ sub setupAppleWinEnv()
} else {
if (!defined $ENV{'WEBKIT_LIBRARIES'} || !$ENV{'WEBKIT_LIBRARIES'}) {
print "Warning: You must set the 'WebKit_Libraries' environment variable\n";
print " to be able build WebKit from within Visual Studio 2013 and newer.\n";
print " to be able build WebKit from within Visual Studio 2017 and newer.\n";
print " Make sure that 'WebKit_Libraries' points to the\n";
print " 'WebKitLibraries/win' directory, not the 'WebKitLibraries/' directory.\n\n";
}
if (!defined $ENV{'WEBKIT_OUTPUTDIR'} || !$ENV{'WEBKIT_OUTPUTDIR'}) {
print "Warning: You must set the 'WebKit_OutputDir' environment variable\n";
print " to be able build WebKit from within Visual Studio 2013 and newer.\n\n";
print " to be able build WebKit from within Visual Studio 2017 and newer.\n\n";
}
if (!defined $ENV{'MSBUILDDISABLENODEREUSE'} || !$ENV{'MSBUILDDISABLENODEREUSE'}) {
print "Warning: You should set the 'MSBUILDDISABLENODEREUSE' environment variable to '1'\n";
@@ -1885,19 +1805,14 @@ sub setupCygwinEnv()

my $programFilesPath = programFilesPath();
my $visualStudioPath = File::Spec->catfile(visualStudioInstallDir(), qw(Common7 IDE devenv.com));
if (-e $visualStudioPath) {
# Visual Studio is installed;
if (visualStudioVersion() eq "12") {
$visualStudioPath = File::Spec->catfile(visualStudioInstallDir(), qw(Common7 IDE devenv.exe));
}
} else {
if (!-e $visualStudioPath) {
# Visual Studio not found, try VC++ Express
$visualStudioPath = File::Spec->catfile(visualStudioInstallDir(), qw(Common7 IDE WDExpress.exe));
if (! -e $visualStudioPath) {
print "*************************************************************\n";
print "Cannot find '$visualStudioPath'\n";
print "Please execute the file 'vcvars32.bat' from\n";
print "'$programFilesPath\\Microsoft Visual Studio 14.0\\VC\\bin\\'\n";
print "your Visual Studio 2017 installation\n";
print "to setup the necessary environment variables.\n";
print "*************************************************************\n";
die;
@@ -2224,11 +2139,7 @@ sub generateBuildSystemFromCMakeProject
push @args, "Ninja";
}
} elsif (isAnyWindows() && isWin64()) {
if (visualStudioVersion() >= 15) {
push @args, '-G "Visual Studio 15 2017 Win64"';
} else {
push @args, '-G "Visual Studio 14 2015 Win64"';
}
push @args, '-G "Visual Studio 15 2017 Win64"';
}
# Do not show progress of generating bindings in interactive Ninja build not to leave noisy lines on tty
push @args, '-DSHOW_BINDINGS_GENERATION_PROGRESS=1' unless ($willUseNinja && -t STDOUT);

0 comments on commit 2897669

Please sign in to comment.