How to build PhantomJS from sources on Windows

In this tutorial we will describe, how to build PhantomJS from main branch of the PhantomJS repository.
1) Download sources, as described on official PhantomJS site :
git clone git://
cd phantomjs
git submodule init
git submodule update
2) Start Developer Command Prompt for VS2015:
3) In Developer Command Prompt change directory to phantomjs directory.
4) Enable Build with Multiple Processes ( – run in the console:
Info about CL Environment Variables –
5) Remove all files from directory phantomjs\src\qt\3rdparty\libicu\ . 
6) Now we need to configure phantomjs build to use custom ICU, when it will build webkit / qtwebkit. As described at the page , you will need to download precompiled ICU packages from . In this tutorial I will use .

Download it and extract into the phantomjs\src\qt\3rdparty\libicu\ .

7) Download and install required for build software – you must have Perl, Python, Ruby, and Git on PATH.
8) Download and unpack it into the phantomjs\src\qt\3rdparty\gnuwin32\bin\ (with files overwriting). Rename win_flex.exe to flex.exe and win_bison.exe to bison.exe with replacement of old files both.
9) Run in the Developer Command Prompt: 
SET INCLUDE=%CD%\src\qt\3rdparty\libicu\include;%INCLUDE%
SET LIB=%CD%\src\qt\3rdparty\libicu\lib;%LIB%
SET PATH=%CD%\src\qt\3rdparty\libicu\lib;%PATH%
SET PATH=%CD%\src\qt\3rdparty\gnuwin32\bin;%PATH%
10) Start build: