Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Building

Markus Rännare edited this page Sep 7, 2020 · 4 revisions

In this guide we build the mod.io NDLL needed to add mod.io functionality into Haxe projects. The NDLL acts as a "glue code" between C and Haxe, you write your functions on C and then you can call them on Haxe by using Haxe's C Foreign Functions Interface. You build the NDLL just like any other shared library on your C++ compiler. Use the corresponding command to build it.

Prerequisites

  1. Haxe: make sure you have installed the latest version of Haxe.
  2. hxcpp: after installing haxe install hxcpp library by typing haxelib install hxcpp on your terminal.

Compiling the NDLL

Visual Studio on Windows

Tested on Visual Studio 16 2019, should work on Visual Studio 2016 too. You will need to install the Visual Studio C++ Redistributable beforehand.

Run the following in the x86 Native Tools Command prompt:

mkdir build
cd build
cmake -G "Visual Studio 16 2019" -AWin32 ..
cmake --build . --config MinSizeRel

The ndll is now located at bin/MinSizeRel/modioWrapperWindows_x86.ndll.

Alternatively, open the cmake project through File > Open > CMake... visual studio and under manage configurations... Add a x86 target and build that.

G++ on Linux

mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake --build . --config MinSizeRel

The ndll is now located at bin/modioWrapperLinux_x64.ndll.

You will get the best experience if you build through clion

Clang on Mac OS

mkdir build
cd build
cmake -G "Xcode" ..

Then open the solution generated in build and build it.

The ndll is now located at bin/modioWrapperMacOS.ndll.

Clone this wiki locally