Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Build il2cpp generated c++ code on Linux

Discussion in 'Linux' started by Grl-Kiko, Oct 1, 2023.

  1. Grl-Kiko

    Grl-Kiko

    Joined:
    Mar 16, 2015
    Posts:
    12
    On windows, there is an option to generate vs file where you can run and debug the c++ generated files.
    Is there something similar for Linux (i.e. how do I compile and debug the generated c++ files for Linux)?
     
  2. tylerinthezoo

    tylerinthezoo

    Unity Technologies

    Joined:
    Jun 15, 2022
    Posts:
    96
    i think you could generate il2cpp debug build? then attaching a debugger should work, as long as you have all the debug symbols in the debug build. open the c++ files you want to set breakpoint with vscode or gdb, and set a breakpoint there.
     
    Last edited: Oct 2, 2023
  3. Grl-Kiko

    Grl-Kiko

    Joined:
    Mar 16, 2015
    Posts:
    12
    Thank you for your feedback. I'd like to build the project on Linux from the c++ files, the same way I can build it using vs from windows. Is this possible?
     
  4. tylerinthezoo

    tylerinthezoo

    Unity Technologies

    Joined:
    Jun 15, 2022
    Posts:
    96
    i'd like to understand more context. first off, there is no visual studio support on linux, so i do not think that work flow which i would assume you meant is debugging everything in some sort of ide is possible.
     
  5. Grl-Kiko

    Grl-Kiko

    Joined:
    Mar 16, 2015
    Posts:
    12
    I meant something similar.
    Basically I'd like to build from c++ source on Linux (with make for example).
     
  6. tylerinthezoo

    tylerinthezoo

    Unity Technologies

    Joined:
    Jun 15, 2022
    Posts:
    96
    not sure if i understand you correctly. you can build the source code since you already have it, you would need to write a make file if you want to customize. i guess a cmake file could be generated along the way if all possible, but i don't think there is any yet.
     
  7. Grl-Kiko

    Grl-Kiko

    Joined:
    Mar 16, 2015
    Posts:
    12
    When you choose windows as a target (with il2cpp active) , and check the generate visual studio files, some extra files are generated (like main, etc...). When you open the visual studio solution, you can build and run the entire game from the generated c++ code.
    When you target Linux though, some of those files are missing (there is no main function for example), and there is no way to build the project from the c++ code (like a build script or a make file).
    I would expect that when Linux is chosen, like its windows counterpart, complete c++ code is generated (with needed main functions, etc...) and a build script or make file to build the project in Linux.
     
  8. tylerinthezoo

    tylerinthezoo

    Unity Technologies

    Joined:
    Jun 15, 2022
    Posts:
    96
    okay, i am not aware of anything alike on linux. il2cpp codes are compiled into gameassembly.so. I do not know what apis gameassembly.so would expose to you.