bmx-ng / bcc

A next-generation bcc parser for BlitzMax
zlib License
33 stars 12 forks source link

Intermediary files: change naming scheme to include all compiler flags #569

Open GWRon opened 3 years ago

GWRon commented 3 years ago

As the title says, the compiler has various FLAGS (on off settings)

A code file could contain ?debug, it can be a console build, a gui build, it can be a shared library or ... you got it. It can contain all the conditionals the documentation lists. Each conditional could contain code only being in the file when the corresponding compiler flag is used.

When BMK and BCC try to check if compilation is needed, they look up for eg "filename.bmx.gui.release.linux.x64.o". If we wanted to distinguish for more elements (eg ?gdbdebug builds) the filenames would become longer and longer - "filename.bmx.gui.debug.gdbdebug.sharedlibrary.linux.x64.o".

My suggestion is now to simply have all the compiler "on off flags" to be stored in a bitmask and all "enum"-like elements would still be added. So filenames would become ""filename.bmx.linux.x64.65.o" if the flags 64 and 1 are enabled (whatever they may be then).

Yes, the files in ".bmx" would be less easier to "identify" regarding the used compiler flags - but it would allow for a fine grained precompile cache.

This is currently not happening. In a worst case scenario you now mix "caches" of files compiled with different compiler flags.