Переглянути джерело

Update to VS 2017 and CMake 3.11.2 (#1347)

* Change build to prefer VS 2017

* Update supported cmake version

* Remove -vs2017 from appveyor.yml
Helena Kotas 7 роки тому
батько
коміт
c3587a82fb
4 змінених файлів з 24 додано та 24 видалено
  1. 1 1
      appveyor.yml
  2. 5 4
      cmake/modules/FindDiaSDK.cmake
  3. 15 18
      utils/hct/hctbuild.cmd
  4. 3 1
      utils/hct/hctstart.cmd

+ 1 - 1
appveyor.yml

@@ -19,7 +19,7 @@ before_build:
 - cmd: call utils\hct\hctstart %HLSL_SRC_DIR% %HLSL_BLD_DIR%
 - cmd: call utils\hct\hctstart %HLSL_SRC_DIR% %HLSL_BLD_DIR%
 
 
 build_script:
 build_script:
-- cmd: call utils\hct\hctbuild -%PLATFORM% -%CONFIGURATION% -vs2017 -spirvtest
+- cmd: call utils\hct\hctbuild -%PLATFORM% -%CONFIGURATION% -spirvtest
 
 
 test_script:
 test_script:
 - ps:  utils\appveyor\appveyor_test.ps1
 - ps:  utils\appveyor\appveyor_test.ps1

+ 5 - 4
cmake/modules/FindDiaSDK.cmake

@@ -12,14 +12,15 @@ get_filename_component(VS15_P_PATH32 "C:/Program Files (x86)/Microsoft Visual St
 get_filename_component(VS15_E_PATH32 "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE" ABSOLUTE CACHE)
 get_filename_component(VS15_E_PATH32 "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE" ABSOLUTE CACHE)
 
 
 # Find the TAEF path, it will typically look something like this.
 # Find the TAEF path, it will typically look something like this.
+# C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\DIA SDK\include
 # C:\Program Files (x86)\Microsoft Visual Studio 14.0\DIA SDK\include\dia2.h
 # C:\Program Files (x86)\Microsoft Visual Studio 14.0\DIA SDK\include\dia2.h
 find_path(DIASDK_INCLUDE_DIR    # Set variable DIASDK_INCLUDE_DIR
 find_path(DIASDK_INCLUDE_DIR    # Set variable DIASDK_INCLUDE_DIR
           dia2.h                # Find a path with dia2.h
           dia2.h                # Find a path with dia2.h
+          HINTS "${VS15_C_PATH32}/../../DIA SDK/include" 
+          HINTS "${VS15_P_PATH32}/../../DIA SDK/include"
+          HINTS "${VS15_E_PATH32}/../../DIA SDK/include"
           HINTS "${VS_PATH64}/../../DIA SDK/include"
           HINTS "${VS_PATH64}/../../DIA SDK/include"
-		  HINTS "${VS_PATH32}/../../DIA SDK/include"
-		  HINTS "${VS15_C_PATH32}/../../DIA SDK/include"
-		  HINTS "${VS15_P_PATH32}/../../DIA SDK/include"
-		  HINTS "${VS15_E_PATH32}/../../DIA SDK/include"
+          HINTS "${VS_PATH32}/../../DIA SDK/include"
           DOC "path to DIA SDK header files"
           DOC "path to DIA SDK header files"
           HINTS
           HINTS
           )
           )

+ 15 - 18
utils/hct/hctbuild.cmd

@@ -40,8 +40,8 @@ if "%BUILD_ARCH%"=="" (
   set BUILD_ARCH=Win32
   set BUILD_ARCH=Win32
 )
 )
 
 
-set BUILD_GENERATOR=Visual Studio 14 2015
-set BUILD_VS_VER=2015
+set BUILD_GENERATOR=Visual Studio 15 2017
+set BUILD_VS_VER=2017
 set BUILD_CONFIG=Debug
 set BUILD_CONFIG=Debug
 set DO_SETUP=1
 set DO_SETUP=1
 set DO_BUILD=1
 set DO_BUILD=1
@@ -86,11 +86,11 @@ if "%1"=="-x64" (
   set BUILD_ARCH=x64
   set BUILD_ARCH=x64
   shift /1
   shift /1
 )
 )
-if "%1"=="-arm" (
+if /i "%1"=="-arm" (
   set BUILD_ARCH=ARM
   set BUILD_ARCH=ARM
   shift /1
   shift /1
 )
 )
-if "%1"=="-arm64" (
+if /i "%1"=="-arm64" (
   set BUILD_ARCH=ARM64
   set BUILD_ARCH=ARM64
   shift /1
   shift /1
 )
 )
@@ -103,8 +103,11 @@ if "%1"=="-Release" (
   shift /1
   shift /1
 )
 )
 if "%1"=="-vs2017" (
 if "%1"=="-vs2017" (
-  set BUILD_GENERATOR=Visual Studio 15 2017
-  set BUILD_VS_VER=2017
+  shift /1
+)
+if "%1"=="-vs2015" (
+  set BUILD_GENERATOR=Visual Studio 14 2015
+  set BUILD_VS_VER=2015
   shift /1
   shift /1
 )
 )
 
 
@@ -211,22 +214,16 @@ echo Cross-compiling enabled.
 
 
 rem This parameter is used with vcvarsall to force use of 64-bit build tools
 rem This parameter is used with vcvarsall to force use of 64-bit build tools
 rem instead of 32-bit tools that run out of memory.
 rem instead of 32-bit tools that run out of memory.
-if "%BUILD_ARCH%"=="Win32" (
+if /i "%BUILD_ARCH%"=="Win32" (
   set BUILD_TOOLS=amd64_x86
   set BUILD_TOOLS=amd64_x86
-) else if "%BUILD_ARCH%"=="x64" (
+) else if /i "%BUILD_ARCH%"=="x64" (
   set BUILD_TOOLS=amd64
   set BUILD_TOOLS=amd64
-) else if "%BUILD_ARCH%"=="ARM" (
+) else if /i "%BUILD_ARCH%"=="ARM" (
   set BUILD_TOOLS=amd64_arm
   set BUILD_TOOLS=amd64_arm
-) else if "%BUILD_ARCH%"=="ARM64" (
+) else if /i "%BUILD_ARCH%"=="ARM64" (
   set BUILD_TOOLS=amd64_arm64
   set BUILD_TOOLS=amd64_arm64
 )
 )
 
 
-if "%BUILD_ARCH%"=="ARM" (
-  echo.
-  echo WARNING: ARM build is not supported. Your build may fail. Use ARM64 instead.
-  echo.
-)
-
 call :configandbuild %BUILD_CONFIG% %BUILD_ARCH% %HLSL_BLD_DIR% "%BUILD_GENERATOR%"
 call :configandbuild %BUILD_CONFIG% %BUILD_ARCH% %HLSL_BLD_DIR% "%BUILD_GENERATOR%"
 if errorlevel 1 exit /b 1
 if errorlevel 1 exit /b 1
 
 
@@ -242,7 +239,7 @@ exit /b 0
 echo Builds HLSL solutions and the product and test binaries for the current
 echo Builds HLSL solutions and the product and test binaries for the current
 echo flavor and architecture.
 echo flavor and architecture.
 echo.
 echo.
-echo hctbuild [-s or -b] [-alldef] [-analyze] [-fv] [-rel] [-arm or -arm64 or -x86 or -x64] [-Release] [-Debug] [-vs2017] [-ninja] [-tblgen path]
+echo hctbuild [-s or -b] [-alldef] [-analyze] [-fv] [-rel] [-arm or -arm64 or -x86 or -x64] [-Release] [-Debug] [-vs2015] [-ninja] [-tblgen path]
 echo.
 echo.
 echo   -s   creates the projects only, without building
 echo   -s   creates the projects only, without building
 echo   -b   builds the existing project
 echo   -b   builds the existing project
@@ -265,7 +262,7 @@ echo.
 echo AppVeyor Support
 echo AppVeyor Support
 echo   -Release builds release
 echo   -Release builds release
 echo   -Debug builds debug
 echo   -Debug builds debug
-echo   -vs2017 uses Visual Studio 2017 to build
+echo   -vs2015 uses Visual Studio 2015 to build; ARM64 not supported 
 echo.
 echo.
 echo ARM build support
 echo ARM build support
 echo   -tblgen sets path to x86 or x64 versions of clang-tblgen and llvm-tblgen tools
 echo   -tblgen sets path to x86 or x64 versions of clang-tblgen and llvm-tblgen tools

+ 3 - 1
utils/hct/hctstart.cmd

@@ -244,9 +244,11 @@ cmake --version | findstr 3.7.2 1>nul 2>nul
 if "0"=="%ERRORLEVEL%" exit /b 0
 if "0"=="%ERRORLEVEL%" exit /b 0
 cmake --version | findstr 3.9.0-MSVC 1>nul 2>nul
 cmake --version | findstr 3.9.0-MSVC 1>nul 2>nul
 if "0"=="%ERRORLEVEL%" exit /b 0
 if "0"=="%ERRORLEVEL%" exit /b 0
+cmake --version | findstr 3.11.2 1>nul 2>nul
+if "0"=="%ERRORLEVEL%" exit /b 0
 cmake --version | findstr /R 3.6.*MSVC 1>nul 2>nul
 cmake --version | findstr /R 3.6.*MSVC 1>nul 2>nul
 if errorlevel 1 (
 if errorlevel 1 (
-  echo CMake 3.4.3, 3.7.2, or 3.9.0 are the currently supported versions for VS 2015 and VS 2017 - your installed cmake is not supported.
+  echo CMake 3.4.3, 3.7.2, 3.9.0 or 3.11.2 are the currently supported versions for VS 2015 and VS 2017 - your installed cmake is not supported.
   echo See README.md at the root for an explanation of dependencies.
   echo See README.md at the root for an explanation of dependencies.
   exit /b 1
   exit /b 1
 )
 )