mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #16307 - UK992:msvc2017, r=larsbergstrom
Add support for Visual Studio 2017 This adds support for Visual Studio 2017. Also need update cmake to 3.7.2. r? @larsbergstrom Can you please upload [this cmake](https://www.dropbox.com/s/3b2z36jj4gh4qpk/cmake-3.7.2.zip?dl=0) to s3 bucket? <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16307) <!-- Reviewable:end -->
This commit is contained in:
commit
065f50014f
4 changed files with 32 additions and 6 deletions
22
mach.bat
22
mach.bat
|
@ -1,6 +1,22 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
SET VS_VCVARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat
|
IF EXIST "%ProgramFiles(x86)%" (
|
||||||
|
set "ProgramFiles32=%ProgramFiles(x86)%"
|
||||||
|
) ELSE (
|
||||||
|
set "ProgramFiles32=%ProgramFiles%"
|
||||||
|
)
|
||||||
|
|
||||||
|
set VC14VARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat
|
||||||
|
IF EXIST "%VC14VARS%" (
|
||||||
|
set "VS_VCVARS=%VC14VARS%"
|
||||||
|
) ELSE (
|
||||||
|
for %%e in (Enterprise Professional Community) do (
|
||||||
|
IF EXIST "%ProgramFiles32%\Microsoft Visual Studio\2017\%%e\VC\Auxiliary\Build\vcvarsall.bat" (
|
||||||
|
set "VS_VCVARS=%ProgramFiles32%\Microsoft Visual Studio\2017\%%e\VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
IF EXIST "%VS_VCVARS%" (
|
IF EXIST "%VS_VCVARS%" (
|
||||||
IF NOT DEFINED Platform (
|
IF NOT DEFINED Platform (
|
||||||
IF EXIST "%ProgramFiles(x86)%" (
|
IF EXIST "%ProgramFiles(x86)%" (
|
||||||
|
@ -11,8 +27,8 @@ IF EXIST "%VS_VCVARS%" (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) ELSE (
|
) ELSE (
|
||||||
ECHO Visual Studio 2015 is not installed.
|
ECHO Visual Studio 2015 or 2017 is not installed.
|
||||||
ECHO Download and install Visual Studio 2015 from https://www.visualstudio.com/
|
ECHO Download and install Visual Studio 2015 or 2017 from https://www.visualstudio.com/
|
||||||
EXIT /B
|
EXIT /B
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
from __future__ import absolute_import, print_function
|
from __future__ import absolute_import, print_function
|
||||||
|
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
|
from distutils.version import StrictVersion
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
@ -204,10 +205,19 @@ def windows_msvc(context, force=False):
|
||||||
def package_dir(package):
|
def package_dir(package):
|
||||||
return os.path.join(deps_dir, package, version(package))
|
return os.path.join(deps_dir, package, version(package))
|
||||||
|
|
||||||
|
def check_cmake(version):
|
||||||
|
cmake_path = find_executable("cmake")
|
||||||
|
if cmake_path:
|
||||||
|
cmake = subprocess.Popen([cmake_path, "--version"], stdout=PIPE)
|
||||||
|
cmake_version = cmake.stdout.read().splitlines()[0].replace("cmake version ", "")
|
||||||
|
if StrictVersion(cmake_version) >= StrictVersion(version):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
to_install = {}
|
to_install = {}
|
||||||
for package in packages.WINDOWS_MSVC:
|
for package in packages.WINDOWS_MSVC:
|
||||||
# Don't install CMake if it already exists in PATH
|
# Don't install CMake if it already exists in PATH
|
||||||
if package == "cmake" and find_executable(package):
|
if package == "cmake" and check_cmake(version("cmake")):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not os.path.isdir(package_dir(package)):
|
if not os.path.isdir(package_dir(package)):
|
||||||
|
|
|
@ -18,7 +18,7 @@ WINDOWS_GNU = set([
|
||||||
])
|
])
|
||||||
|
|
||||||
WINDOWS_MSVC = {
|
WINDOWS_MSVC = {
|
||||||
"cmake": "3.6.1",
|
"cmake": "3.7.2",
|
||||||
"moztools": "0.0.1-5",
|
"moztools": "0.0.1-5",
|
||||||
"ninja": "1.7.1",
|
"ninja": "1.7.1",
|
||||||
"openssl": "1.1.0e-vs2015",
|
"openssl": "1.1.0e-vs2015",
|
||||||
|
|
|
@ -50,7 +50,7 @@ def host_triple():
|
||||||
cpu_type = platform.machine().lower()
|
cpu_type = platform.machine().lower()
|
||||||
if os_type.endswith("-msvc"):
|
if os_type.endswith("-msvc"):
|
||||||
# vcvars*.bat should set it properly
|
# vcvars*.bat should set it properly
|
||||||
platform_env = os.environ.get("PLATFORM")
|
platform_env = os.environ.get("PLATFORM").upper()
|
||||||
if platform_env == "X86":
|
if platform_env == "X86":
|
||||||
cpu_type = "i686"
|
cpu_type = "i686"
|
||||||
elif platform_env == "X64":
|
elif platform_env == "X64":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue