0

I want to have a crossplatform application (including browser integration). I have C++ library\algorithms I want to use in form of sources (to make Unity compile it on each platform). I know it could work if I use Mac or WebGL as primary build targets. Yet I have windows as my primary user base. So I want to use IL2CPP on windows to compile my C# and C++ code.

How to structure project and set IL2CPP to compile C++ files in unity on windows in order to create windows executable?

DuckQueen
  • 772
  • 10
  • 62
  • 134

2 Answers2

1

You can talk with C or C++ (and others depending on your target platforms) libraries using Native Plugins. It is even possible to use to call C++ function from a plugin using WebGL thanks to emscripten compilation.

Note that it has nothing to do with IL2CPP. IL stands for Intermediate Language (IL), the low-level output from .NET compilers. Your C++ code will be compiled directly to machine code/ASM code and will be called from within your script code. Your script will either be running on the Mono virtual machine or using IL2CPP (depending on the platform).

DurandA
  • 1,095
  • 1
  • 17
  • 35
  • More on IL2CPP internals on [this Unity blog post](https://blogs.unity3d.com/2015/05/06/an-introduction-to-ilcpp-internals/). – DurandA Mar 05 '17 at 01:14
0

This is not possible now, as Unity does not support IL2CPP as a scripting backend for the Windows standalone target.

Josh Peterson
  • 2,299
  • 19
  • 21