1 Windows 2 ======= 3 4 Prerequisites 5 ------------- 6 7 Make sure the following have been installed: 8 9 * [Visual C++ 2013 Express or later, available for 10 free](https://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-8) 11 12 * [Chromium depot_tools](https://www.chromium.org/developers/how-tos/depottools) 13 14 * Git 15 - Either use the mysygit installed by depot_tools 16 - Or [install git-for-windows 17 yourself](https://git-for-windows.github.io/). 18 19 * Python 2.7.x (if you're not planning to use cygwin) 20 - available for free download at 21 [python.org](https://www.python.org/download/releases/) 22 - make sure the installer changes your %PATH% environment variable 23 to include the directory with the "python.exe" binary 24 25 * Cygwin (**optional**, but useful if you want to use git) 26 - Download from https://www.cygwin.com/setup-x86.exe or 27 https://www.cygwin.com/setup-x86_64.exe 28 - Use any mirror you like; http://lug.mtu.edu works well 29 - Cygwin installs a minimum of options. Add these packages if they 30 aren't already selected: 31 + Devel git 32 + Devel subversion 33 + Editors vim 34 * to fix arrows in insert, copy 35 `/usr/share/vim/vim73/vimrc_example.vim` to `~/.vimrc` 36 + Net ca-certificates 37 + Python python 38 + Utils patch 39 + Utils util-linux 40 - Set the windows envionment variable CYGWIN to nodosfilewarning 41 42 Check out the source code 43 ------------------------- 44 45 Follow the instructions [here](../download) for downloading the Skia source. 46 47 Gyp Generators on Windows 48 ------------------------- 49 50 We use the open-source Gyp tool to generate Visual Studio projects (and 51 analogous build scripts on other platforms) from our multi-platform "gyp" 52 files. 53 54 Three Gyp generators are used on Windows: 55 56 * `ninja` - Run ninja yourself, without VisualStudio project files, 57 58 * `msvs-ninja` - Develop from a fully-integrated Visual Studio. 59 Gyp generates Visual-Studio-compatible project files that still 60 ultimately build using ninja 61 62 * `msvs` - Use Visual Studio's own (slower) build system 63 64 To choose which ones to use, set the `GYP_GENERATORS` environment 65 variable to a comma-delimited list of generators before running 66 sync-and-gyp. The default value for `GYP_GENERATORS` is 67 `ninja,msvs-ninja`. For example to enable the `ninja` and `msvs` 68 generators: 69 70 <a name="env"></a>Setting Enviroment Variables in Windows CMD.EXE 71 ----------------------------------------------------------------- 72 73 cd %SKIA_CHECKOUT_DIR% 74 SET "GYP_GENERATORS=ninja,msvs" 75 python bin/sync-and-gyp 76 SET "GYP_GENERATORS=" 77 78 Build and run tests from the command line 79 ----------------------------------------- 80 81 ninja -C out/Debug dm 82 out\Debug\dm 83 84 See [this page for running Skia tests on all desktop](./desktop) 85 86 Build and run tests in the Visual Studio IDE 87 -------------------------------------------- 88 89 1. Generate the Visual Studio project files by running `sync-and-gyp` as 90 described above 91 92 2. Open a File Explorer window pointing at the 93 `%SKIA_CHECKOUT_DIR%\out\gyp` directory 94 95 3. Double-click on dm.sln to start Visual Studio and load the project 96 97 4. When Visual Studio starts, you may see an error dialog stating that 98 "One or more projects in the solution were not loaded 99 correctly"... but there's probably nothing to worry about. 100 101 5. In the "Solution Explorer" window, right-click on the "dm" project 102 and select "Set as StartUp Project". 103 104 6. In the "Debug" menu, click on "Start Debugging" (or just press 105 F5). If you get a dialog saying that the project is out of date, 106 click on "Yes" to rebuild it. 107 108 7. Once the build is complete, you should see console output from the 109 tests in the "Output" window at lower right. 110 111 Build and run SampleApp in Visual Studio 112 ---------------------------------------- 113 114 1. Generate the Visual Studio project files by running `sync-and-gyp` 115 as described above 116 117 2. Open a File Explorer window pointing at the 118 `%SKIA_INSTALLDIR%\trunk\out\gyp` directory 119 120 3. Double-click on SampleApp.sln 121 122 4. When Visual Studio starts, you may see an error dialog stating 123 that "One or more project s in the solution were not loaded 124 correctly"... but there's probably nothing to worry about. 125 126 5. In the "Debug" menu, click on "Start Debugging" (or just press 127 F5). If you get a dialog saying that the project is out of date, 128 click on "Yes" to rebuild it. 129 130 6. Once the build is complete, you should see a window with various 131 example graphics. To move through the sample app, use the 132 following keypresses: 133 - right- and left-arrow key: cycle through different test pages 134 - 'D' key: cycle through rendering methods for each test page 135 - other keys are defined in SampleApp.cpps 136 SampleWindow::onHandleKey() and SampleWindow::onHandleChar() 137 methods 138