Semi-automatic Compilation with Build Script
A UNIGINE Build script is a one-touch solution to rebuild the engine and tools with different options.
To invoke the build script, run <UnigineSDK>/source/build.py from a console (see examples below). Note that you need to properly set the development environment to get the script working.
Built files can be found in the target directory, in bin and lib folders.
Command Line Options#
--help | Display a help message and exit. | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
--type TYPE | Type of the build (multiple options are accepted). The default is release.
|
||||||||||||||||||||||||||
--bits BITS | Bit count of the target platform. OS native bit count is detected and used as a default one.
|
||||||||||||||||||||||||||
--csharp | Build the C# libraries and the application. | ||||||||||||||||||||||||||
--component COMPONENT | UNIGINE component to build. The default is engine.
|
||||||||||||||||||||||||||
--precision PRECISION | Create a build with single or double precision coordinates support. The default is float.
|
||||||||||||||||||||||||||
--plugin PLUGIN | Build C++ plugins individually or in groups. The default is no. In the evaluation version of UNIGINE SDK, some plugins cannnot be rebuilt.
Plugins are specified in the following way:
|
||||||||||||||||||||||||||
--tool TOOL | Build UNIGINE tools individually or in groups (--component parameter should be set to all or tools). The default is all.
Tools are specified in the following way:
|
||||||||||||||||||||||||||
--log LOGFILE | Create a log file that contains a record of the compilation. By default, no name is specified and the log file is not created. | ||||||||||||||||||||||||||
--simd SIMD | Perform parallel compilation using the SIMD operations. The default is sse2.
|
||||||||||||||||||||||||||
--vs VS | Version of Visual Studio build tools to be used. The default is v141.
|
||||||||||||||||||||||||||
--jobs JOBS | Perform parallel compilation. An argument specifies the number of parallel building jobs to be run. The default is all.
|
||||||||||||||||||||||||||
--clean_source | Clean up the source directory before the compilation starts (i.e. remove pdb, ilk, exp files, etc.). | ||||||||||||||||||||||||||
--clean_target | Delete everything from the target directory before the compilation starts. | ||||||||||||||||||||||||||
--clean_only | Full clean up without compilation. The default is false. | ||||||||||||||||||||||||||
--features BUILD FEATURES | Add features to UNIGINE Engine build. The default is no.
Features are specified in the following way:
|
||||||||||||||||||||||||||
--skip_errors | Skip build errors (if any). When this option is set, the build.py script is run for all of the specified tools and plugins, even if errors occur. The build errors are displayed at the end.
This option allows skipping build errors only for tools and plugins. |
||||||||||||||||||||||||||
--sample | List of samples separated by spaces. | ||||||||||||||||||||||||||
--verbose | Enable verbose output. | ||||||||||||||||||||||||||
--dry-run | Print commands without building. | ||||||||||||||||||||||||||
--batch | Batch mode for msvc compiler. | ||||||||||||||||||||||||||
--watermark | Watermark type.
|
||||||||||||||||||||||||||
--cmake_gen | Cmake generators. | ||||||||||||||||||||||||||
TARGET | The last optional argument is a target directory to store builds, by default it's ../. Two additional directories in the target directory will be created: bin and lib to store the binary executable and libraries, respectively. |
If no options are set, the script will be built with default values.
Usage Examples#
To build the release version of the UNIGINE engine (both the binary executable and the UNIGINE library) for a 64-bit platform, just run the build script:
C:\Windows\system32>c:
C:\Windows\system32>cd c:\UNIGINESDK\source\
C:\UNIGINESDK\source>build.py
In the example below, the debug version of tools will be rebuilt for 32-bit Windows (the current platform):
C:\UNIGINESDK\source>build.py --type=debug --bits=32 --component=tools
To create the debug version of the engine with double precision coordinates support, use the following:
C:\UNIGINESDK\source>build.py --type=debug --precision=double
To build all the C++ and C# samples, type:
C:\UNIGINESDK\source>build.py --component samples --csharp
To build the release version of the GPUMonitor plugin for x64 platform, use the following command:
C:\UNIGINESDK\source>build.py --plugin=GPUMonitor