Having 2 almost identical INC files seems ugly. How do you feel about more symbols? I had posted this example that added EXPORT when _Link_=>1
… always
COMPILE('** Internal **',_Link_) !Compiles when _Link_=>1
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_Link_),DLL(_Dll_), EXPORT
** Internal **
COMPILE('** External **',_Dll_) !Compiles when _Dll_=>1
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_Link_),DLL(_Dll_) ! No => EXPORT
** External **
That’s bad to assume Link(,1) Classes are always exported. Most classes with templates have Multi-DLL criteria that allows selecting if they are Exported.
So to do it right I think there would need to be a _MyExport_
symbol like this:
COMPILE('** Exported **',_MyExport_=1 and _MyLink_=1 )
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_MyLink_), EXPORT
** Exported **
OMIT('** Do Not Export **',_MyExport_=1 and _MyLink_=1 ) !Compiles when _MyLink_ <> 1 OR _MyExport_ <> 1
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_MyLink_),DLL(_MyDll_) ! No => EXPORT, might be External
** Do Not Export **
__
So it takes 3 symbols to have a CLASS with EXP entries for EXPORT “handled” by the build. When dealing with a lot of Symbols I find it easier to create .PR project files instead of using the Project Defines:
-- Include has All Class Link/DLL as External (including this class) --
#include Dll_eic_XclassX.Defines.PR
-- Set This Class as Linked True (overrides above include) --
#pragma define(_E_str_L_=>1)
#pragma define(_E_str_D_=>0)