totalspectrum / spin2cpp

Tool to convert Parallax Propeller Spin code to PASM, C++ or C
Other
46 stars 17 forks source link

--zip ignores conditional assembly #450

Open Wuerfel21 opened 1 month ago

Wuerfel21 commented 1 month ago
CON
  USE_THE_FILE = false
DAT
  orgh
if USE_THE_FILE
  file "does_not.exist"
end

This code compiles correctly but trying to zip it fails with error: Unable to write file does_not.exist to zip

totalspectrum commented 1 month ago

I'm not sure that's actually a bug... if someone flips the USE_THE_FILE switch (or compiles the module with a constant override) then they're going to need the file.

Wuerfel21 commented 1 month ago

That's not exactly wrong, but currently this means it can never ZIP a project using the usbnew driver, for it has a "builtin rules" feature that basically works like the snippet above - i.e. one provides a file containing padmap rules to be hardcoded into the binary and overrides the relevant constant to true, which enables the FILE include. So if this feature (or even the whole EmuPad subsystem) is not used, ZIP-ing the project fails.

totalspectrum commented 1 month ago

Couldn't the usbnew driver provide a sample rules file that could end up in the zip? It seems we'd want one anyway, and if it had the name of the one in the FILE directive it would get zipped up along with the rest of the project.

Wuerfel21 commented 1 month ago

That would work for the demo programs, but you don't want that clutter in a user's project.