Author Topic: Importing and generating code  (Read 3229 times)

EAButNotForGames

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Importing and generating code
« on: September 17, 2024, 06:10:43 pm »
I got a problem:

I have a question:
When I import a Source Directory to store C code in a model and then generate the code of the model, I get some mismatches.
#define, #if define or similar are completely missing. Also, some includes are either missing or changed.
The code generation also rewrites the source code of the class.

I have some questions:
Is this an error in the import or the code generation?
And, if it is an import error, is there someway to customize the code import of EA?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Importing and generating code
« Reply #1 on: September 17, 2024, 07:37:26 pm »
Cross compilation is complex. #-instructions are meant for the compiler and not for runtime. EA simply ignores them. That'a a good idea since keeping track of them would imply a huge meta-model to be stored on top. When EA reads code, it just reads the header files or that part which defines classes. Getting the code into the behavior is tricky (see above) and works only partially. Long story short: code engineering sounds sweet, but reality is harsh. I simply dropped the idea years ago. Nowadays I eventually use the import to create documentation manually.

q.

EAButNotForGames

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Importing and generating code
« Reply #2 on: September 24, 2024, 07:34:07 pm »
Dam. I asked the EA-Support and they gave a similar answer. Sadly EA doesn't have the option to customize the code import...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Importing and generating code
« Reply #3 on: September 24, 2024, 07:55:59 pm »
It's quite fun to write a compiler (I did so for my diploma) but it's nothing you can do on a free aftrenoon. And honestly a Cxx compiler with pre-compiler for the macros would give me the creeps rather than enjoyment.

q.