Browse Source

Improve new user experience (#1)

Improve new developer experience

Update README and hctstart.cmd tools to help new developers.

Update README
    * Add instructions on how to setup the build environment
      from the command line.
    * Add note to install common tools for c++ to get the atl headers.
    * Change cmake download to point to cmake 3.4.3. Version 3.4 did
      not work for me (it could not find the Visual Studio compiler tools).

Modify hctstart.cmd
    * Explicitly check for the d3d12.h header from the 10240 windows kit.
      Without this early check we get a build error much later.
    * Check for cmake version 3.4.3 and warn if not found.

Update gitignore for visual studio code temporary files.
David Peixotto 8 years ago
parent
commit
bb4794ca6c
3 changed files with 38 additions and 5 deletions
  1. 2 0
      .gitignore
  2. 12 4
      README.md
  3. 24 1
      utils/hct/hctstart.cmd

+ 2 - 0
.gitignore

@@ -22,6 +22,8 @@
 .DS_store
 # Dump files from test crashes.
 *.dmp
+# Visual Studio Code directory.
+.vscode
 
 #==============================================================================#
 # Explicit files to ignore (only matches one).

+ 12 - 4
README.md

@@ -22,14 +22,22 @@ The goal of the project is to allow the broader community of shader developers t
 
 Before you build, you will need to have some additional software installed.
 
-* [Install Git](http://git-scm.com/downloads)
-* Visual Studio 2015, Update 3. This will install the Windows Development Kit as a side effect. In the install options, make sure the 10.0.10240.0 SDK is included.
+* [Git](http://git-scm.com/downloads).
+* [Visual Studio 2015](https://www.visualstudio.com/downloads). Update 3 is the supported version. This will install the Windows Development Kit as a side effect. We also need the common tools for visual C++ to get the atl headers (e.g. atlbase.h). In the install options, make sure the following options are checked:
+    * Windows 10 SDK (10.0.10240.0)
+    * Common Tools for Visual C++ 2015
 * [Windows 10 SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk). This is needed to build tests that reference the D3D12 runtime.
 * [Windows Driver Kit](https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit). Or download and install the [Windows Driver Kit 8.1 Update 1](http://www.microsoft.com/en-us/download/details.aspx?id=42273), no need to download and install tests. This will target your common Windows Kits path, on a 64-bit machine this will likely be C:\Program Files (x86)\Windows Kits\8.1. WDK for Windows 10 should also work. This is currently needed to run TAEF tests and build with the TAEF framework.
-* [CMake](http://www.cmake.org/download/). [Version 3.4](https://cmake.org/files/v3.4/cmake-3.4.0-win32-x86.exe) is the supported version. You need not change your PATH variable during installation.
+* [CMake](https://cmake.org/files/v3.4/cmake-3.4.3-win32-x86.exe). Version 3.4.3 is the supported version. You need not change your PATH variable during installation.
 * [Python](https://www.python.org/downloads/). Version 2.7.x is required, 3.x might work but it's not officially supported. You need not change your PATH variable during installation.
 
-To create a shortcut to the build environment, double-click on the utils\hct\hctshortcut.js file.
+To setup the build environment run the `utils\hct\hctstart.cmd` script passing the path to the source and build directories. For example:
+
+    git clone <DirectXShaderCompiler repo> C:\DirectXShaderCompiler
+    cd C:\DirectXShaderCompiler
+    utils\hct\hctstart.cmd C:\DirectXShaderCompiler C:\DirectXShaderCompiler.bin
+
+To create a shortcut to the build environment with the default build directory, double-click on the `utils\hct\hctshortcut.js` file.
 
 To build, open the HLSL Console and run this command.
 

+ 24 - 1
utils/hct/hctstart.cmd

@@ -67,12 +67,21 @@ doskey hcttodo=cscript.exe //Nologo %HLSL_SRC_DIR%\utils\hct\hcttodo.js $*
 doskey hctvs=%HLSL_SRC_DIR%\utils\hct\hctvs.cmd $*
 
 call :checksdk
+if errorlevel 1 (
+  echo Windows SDK not properly installed. Build enviornment could not be setup correctly.
+  exit /b 1
+)
 
 where cmake.exe 1>nul 2>nul
 if errorlevel 1 (
   call :findcmake
 )
 
+call :checkcmake
+if errorlevel 1 (
+  echo WARNING: cmake version is not supported. Your build may fail.
+)
+
 where te.exe 1>nul 2>nul
 if errorlevel 1 (
   call :findte
@@ -151,10 +160,24 @@ if not exist "%kit_root%" (
   echo Windows 10 SDK was installed but is not accessible.
   exit /b 1
 )
-if not exist "%kit_root%\include\10.0.10240.0" (
+if not exist  "%kit_root%\include\10.0.10240.0\um\d3d12.h" (
   echo Unable to find include files for Windows 10 SDK 10.0.10240.0.
+  echo   file "%kit_root%\include\10.0.10240.0\um\d3d12.h" does not exist
   echo Please see the README.md instructions in the project root.
+  exit /b 1
 )
+goto :eof
+endlocal
+
+:checkcmake
+setlocal
+cmake --version | findstr 3.4.3 1>nul 2>nul
+if errorlevel 1 (
+  echo CMake 3.4.3 is the currently supported version - your installed cmake is not supported.
+  echo See README.md at the root for an explanation of dependencies.
+  exit /b 1
+)
+goto :eof
 endlocal
 
 goto :eof