Add option to suppress LINK_LEXER() macro

View: New views
3 Messages — Rating Filter:   Alert me  

Add option to suppress LINK_LEXER() macro

by Florian Balmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

I'm using Scintilla as a static library, and I have removed
unnecessary lexer modules from my project to reduce the size of the
executable file.

I need to manually redefine the LINK_LEXER() macro from KeyWords.cxx
each time I'm updating Scintilla, so as not to generate errors for the
missing lexer modules.

I'd consider it very handy if the LINK_LEXER() macro could be set to
something empty for static builds:

#ifdef STATIC_BUILD
#define LINK_LEXER(lexer) void(0);
#else
#define LINK_LEXER(lexer) ... /* original definition */
#endif

If using the STATIC_BUILD flag is problematic in this context,
introducing a NO_LINK_LEXER flag or similar could also be helpful to
be set as a compiler option.

--Florian
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Add option to suppress LINK_LEXER() macro

by Neil Hodgson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Florian Balmer:

> I'm using Scintilla as a static library, and I have removed
> unnecessary lexer modules from my project to reduce the size of the
> executable file.
>
> I need to manually redefine the LINK_LEXER() macro from KeyWords.cxx
> each time I'm updating Scintilla, so as not to generate errors for the
> missing lexer modules.

   After removing unwanted lexers, run LexGen.py.

   Neil
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Parent Message unknown Re: Add option to suppress LINK_LEXER() macro

by Florian Balmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Neil:

> After removing unwanted lexers, run LexGen.py.

Unfortunately, Python is not ready on my local machines. Anyway,
scripting is a good cue, I've created a batch file to automatically
remove unwanted lexer modules:

if not exist scintilla\src\keywords.cxx goto exit
findstr /v "LINK_LEXER" scintilla\src\keywords.cxx > %temp%.\keywords.cxx
type %temp%.\keywords.cxx > scintilla\src\keywords.cxx
del %temp%.\keywords.cxx
:exit

--Florian
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest