CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
157 stars 51 forks source link

Support of Custom Code (CustomDefine) #402

Closed nl78 closed 1 year ago

nl78 commented 1 year ago

It seems that custom code is only partly supported in grtfmi.tlc.

We tried to declare a define. It seems that option is not correctly passed to compiler (Visual Studio or MinGW). Way to reproduce:

  1. Declare header code (through GUI):

    #ifdef TOTO
    # error "TOTO is well defined"
    #else
    # error "TOTO is not defined"
    #endif
  2. Declare 'TOTO' in define list (through GUI).

Compilation with grtfmi.tlc leads to

...\test_define.h:45:3: error: #error "TOTO is not defined"
 # error "TOTO is not defined"

Compilation with grt.tlc leads to expected "TOTO is well defined".

I attached a SLX to reproduce de issue.

test_define.zip

nl78 commented 1 year ago

May I suggest the following patch ?

slx2fmu-5753a14-Support for custom defines.zip