|
Packit |
ed3af9 |
# Building on Windows with Visual Studio 2015
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* Get the required dependencies from
|
|
Packit |
ed3af9 |
http://windows.php.net/downloads/php-sdk/deps/vc14/ and
|
|
Packit |
ed3af9 |
http://windows.php.net/downloads/pecl/deps/, respectively. Choose the x86 or
|
|
Packit |
ed3af9 |
x64 packages depending on your needs.
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* freetype
|
|
Packit |
ed3af9 |
* libiconv
|
|
Packit |
ed3af9 |
* libjpeg
|
|
Packit |
ed3af9 |
* libpng
|
|
Packit |
ed3af9 |
* libtiff
|
|
Packit |
ed3af9 |
* libwebp
|
|
Packit |
ed3af9 |
* libxpm
|
|
Packit |
ed3af9 |
* zlib
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* Unpack all dependency packages into the same folder.
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* Open the VS2015 x86 or x64 Native Tools Command Prompt.
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* Set the environment variable `WITH_DEVEL` to the path where you have unpacked
|
|
Packit |
ed3af9 |
the dependencies. `WITH_DEVEL` defaults to `..\deps`.
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* If you want a debug build, do
|
|
Packit |
ed3af9 |
````
|
|
Packit |
ed3af9 |
set DEBUG=1
|
|
Packit |
ed3af9 |
````
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* `cd` into the libgd source folder.
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* To build the libraries, do:
|
|
Packit |
ed3af9 |
```
|
|
Packit |
ed3af9 |
nmake /f windows\Makefile.vc
|
|
Packit |
ed3af9 |
```
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* To build and run the tests, do:
|
|
Packit |
ed3af9 |
````
|
|
Packit |
ed3af9 |
nmake /f windows\Makefile.vc check
|
|
Packit |
ed3af9 |
````
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* To build the executable programs, do:
|
|
Packit |
ed3af9 |
````
|
|
Packit |
ed3af9 |
nmake /f windows\Makefile.vc build_progs
|
|
Packit |
ed3af9 |
````
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* After a successful build, you find the libraries and test executables in
|
|
Packit |
ed3af9 |
`..\gdbuild`. You can change the build folder by setting the environment
|
|
Packit |
ed3af9 |
variable `WITH_BUILD` to the desired path.
|
|
Packit |
ed3af9 |
|
|
Packit |
ed3af9 |
* Before rebuilding, you may have to run:
|
|
Packit |
ed3af9 |
```
|
|
Packit |
ed3af9 |
nmake /f windows\Makefile.vc clean
|
|
Packit |
ed3af9 |
```
|