Building

turupawn edited this page Feb 6, 2019 · 24 revisions

This page shows how to compile the mod.io SDK shared library. If you are a Game Developer seeking to add mod.io functionality to your project please refer to the Getting Started guide instead.

Mod.io SDK is built on the top of Zlib, LibCurl and JSON for Modern C++. VisualC++, MinGW, GCC and Clang are supported. In order to build it use CMake combined with your compiler of choice.

sdk-requirements-diagram.png

Windows

VisualC++

Setup

In order to compile using the Visual C++ Redistributable. The nmake command is available on the Visual C++ command line interface provided by the Redistributable or you can add it to your environment path.

We ship the Zlib and Curl binaries under the lib/MSVC directory but feel free to build them yourself by following our guide.

Build

cd src
mkdir build
cd build
cmake -G"NMake Makefiles" ../..
nmake

This will generate the import library modio.lib and the dynamic library modio.dll.

MinGW

Setup

Download and install the MinGW with MinGW32-Make support. Then add the MinGW bin/ directory to your environment path.

We ship the Zlib and Curl binaries under the lib/MinGW directory but feel free to build them yourself by following our guide.

Build

cd src
mkdir build
cd build
cmake -G"MinGW Makefiles" ..
mingw32-make

This will generate the import library libmodio.a and the dynamic library libmodio.dll.

Linux

Setup

Install the following dependencies:

#Debian, Ubuntu
apt install cmake g++ zlib1g-dev libcurl4-gnutls-dev

#Fedora
dnf install cmake gcc-c++ libcurl-devel zlib-devel

Build

mkdir build
cd build
cmake ..
make

This will generate the shared library libmodio.so library.

OSX

Setup

Install the build essentials shipped with XCode.

Build

mkdir build
cd build
cmake ..
make

This will generate the shared library libmodio.dylib library.

Static linking

This article refers to building mod.io as a static library. If instead you want to link a precompiled static library please refer to the Getting Started Guide.

The CMake setup will build the SDK dynamically by default. To build it statically you have to set the mode cache variable to static. For example:

cmake -D mode=static ..

This will generate the modio.lib or libmodio.a static library depending on your target.

Contents

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.