For more information, see
Feedback, issues and pull requests are always welcome, please see the Github issues page.
git clone git://github.com/enginetrouble/gyp-getting-started.git
- Python 2.7+ (:warning: GYP does not support Python 3, at the moment)
- Xcode 5 and 6
- Visual Studio 2013
First, install GYP from https://chromium.googlesource.com/external/gyp.
Make sure git
is installed.
From the root of your engine directory (cd gyp-getting-started
), run:
git clone https://chromium.googlesource.com/external/gyp.git tools/gyp
Second, run setup.py
:
Linux and Mac OSX
To install globally with gyp:
cd tools/gyp
[sudo] python setup.py install
Windows
cd tools/gyp
python setup.py install
gyp build/trivial.gyp --depth=. -f xcode --generator-output=build.xcodefiles
xcodebuild -project build.xcodefiles/build/trivial.xcodeproj
To build in release mode, use -configuration
option:
xcodebuild -project build.xcodefiles/build/trivial.xcodeproj -configuration Release
build/build/Release/TrivialTest
To generate visual studio project files in Windows default command prompt, run gyp\gyp
(same as gyp\gyp.bat
):
tools\gyp\gyp build/trivial.gyp --depth=. -f msvs -G msvs_version=2013
If you use Git Bash (MinGW) or Cygwin, an alternative method is gyp/gyp
(shell script, not .bat
file):
tools/gyp/gyp build/trivial.gyp --depth=. -f msvs -G msvs_version=2013
You can also use the python gyp_main.py
instead of gyp
command:
python tools/gyp/gyp_main.py build/trivial.gyp --depth=. -f msvs -G msvs_version=2013
An Visual Studio solution file (build/trivial.sln
) has been created in your directory.
If you use the Visual Studio 2013, run the following in a command prompt:
set Path=C:\Program Files (x86)\MSBuild\12.0\Bin\;%PATH%
To compile and create an executable file, run the following command:
MSBuild build\trivial.sln /t:Build
Using /p:Configuration
you can specify the build configuration:
MSBuild build\trivial.sln /t:Build /p:Configuration=Release
build\Debug\TrivialTest
If you get the following error, Python can't find setuptools
module.
$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 7, in <module>
from setuptools import setup
ImportError: No module named setuptools
You can install python modules and try again:
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
python setup.py install
For more information about installing setuptools
, please see https://pypi.python.org/pypi/setuptools#unix-wget.