Search Unity

IL2CPP generate CPP without exceptions?

Discussion in 'Web' started by techmage, Dec 31, 2021.

  1. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    This is a complete shot in the dark, but is there a way to generate code from IL2CPP that has no exceptions in it? I already have "Enable Exceptions" set to "None" in the editor, but the resulting CPP code still has try catch blocks and is still compiled with exceptions enabled in emscripten.

    I assume the editor is just disabling managing exceptions?

    Is there any way to fully disable CPP exceptions so I can compile the CPP code with the no-exceptions flag set?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Are you specifically talking about the WebGL build target?
     
  3. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Yes, generally. But I am trying to use the WebGL build output a little different than run it in a browser. Which is why I am curious if it can be generated with exceptions as it makes the results wasm simpler.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I moved the thread to the WebGL forum as the people who might have the answers are more likely to hang out there.
     
  5. OceanX000

    OceanX000

    Joined:
    Feb 24, 2021
    Posts:
    120
    I also have the same question, for performance and generation size, I just want to catch C# logic exceptions, but native and il2cpp do not catch exceptions. How to do that?