# Build

Prebuilt binaries are currently not supplied. The integration code is very lightweight. Integrations have two options:

1. Copy the code in one/arcus directly into the game engine and build directly as part of the regular build.
2. Or build the repository with the following instructions, and then copy required headers and binaries. Binaries will be output into the build folder; for example, the build/one/arcus/release/one\_arcus.lib.

It's recommended to build the repository as it will also create a fake agent executable to aid testing of your game server without deploying to the remote ONE Platform.

## Requirements

In order to build the source, you must ensure you have the following dependencies installed on your system.

1. You need a C++ compiler.
   * Windows: [Visual Studio 2017, or build tools (without Editor)](https://visualstudio.microsoft.com/vs/older-downloads/)
   * Linux: GCC (7.5.0 tested)
2. [CMake 3.17.4](https://cmake.org/files/v3.17/). This is used to configure and build the project. See the top of CMakeLists.txt for other CMake versions tested, if you are already using a different version.
3. After the initial repository clone, initialize the git submodules with the following command:

```
git submodule update --init --recursive
```

4. On Linux, ensure you installed Open SSL (used by curl, for testing, as of 2022-06-01):

```
sudo apt-get update
sudo apt-get install libssl-dev
```

### Optional

1. For documentation generation:
   * Windows:
     1. [doxygen](https://www.doxygen.nl/manual/install.html#install_bin_windows)
     2. [graphviz](https://graphviz.org/download/)
   * Ubuntu:
     1. `sudo apt-get update`
     2. `sudo apt-get install doxygen graphviz`
2. For buiding Linux libraries on Windows:
   * [Docker](https://www.docker.com/products/docker-desktop)

## Steps

Build scripts for both platforms can be found in the tools folder. The build scripts naming follows the following convention:

`build_<debug_or_release>_<platform>_<shared_or_static_library>_<architecture>` Windows will also have a trailing `mt` or `mtdll` for the code generation CRT configuration (Multi Threaded vs Multi Threaded DLL).

For example, build\_release\_windows\_32\_dll\_mt.bat will configure and build on windows a release, 32 bit, multi-threaded (MT option in MSVC) dll library.

Running a build script will build the source, run tests, and output results to the build folder.

A clean is needed in most cases when building with different settings.

## Clean

Run either script in the root:

* clean\_windows.bat
* clean\_linux.sh

Cleaning is not required when changing between debug and release builds with other settings being equal.

## Automated build

**build\_release\_dlls.bat** will build dll/so libraries for Windows and Linux, outputing them to a shared\_lib\_build folder in the root. Docker is required.

## IDE

To load the repository in Visual Studio, first build and then open the generated solution file located at build/OneGameHostingSDK.sln.

For working on the SDK in Visual Studio Code, IDE tips are located [here](https://github.com/i3D-net/ONE-GameHosting-SDK/blob/master/docs/vscode.md).

## Documentation Build

The doxygen documentation is built automatically if CMake is able to find the doxygen installed on your system.

## Testing

As noted above, short tests are run at the end of the cmake build, by default.

Run the following bash scripts from within the tools folder to run longer tests:

* run\_tests\_debug\_long.sh
* run\_tests\_debug\_soak.sh

Use the `build/tests/debug/tests.exe -?` option for all commands.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/game-hosting/game-integration/sdk-overview/build.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
