Ticket #48702

specenum generator: Initial implementation

Eröffnet am: 2023-09-23 06:01 Letztes Update: 2023-09-26 05:42

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
4

Details

Part of #48675.

Initial step (first subticket) should be possible without build system integration - expect developer to run the script manually, and keep the resulting header under version control. Shouldn't do that for a large number of generated headers, but just for the first.

This ticket is about writing the script with at least the basic functionality and using it to replace the enums in just one or a few headers (to test/showcase), calling it manually when the definition is changed.

Ticket-Verlauf (3/10 Historien)

2023-09-23 06:01 Aktualisiert von: alienvalkyrie
  • New Ticket "specenum generator: Initial implementation" created
2023-09-23 06:14 Aktualisiert von: alienvalkyrie
Kommentar

Made a proof-of-concept patch, migrating the enums of common/terrain.h; depends on #44767 in that it requires Python 3.6. This just has everything in gen_headers (no separate subdirectory yet). Added that to the include directories as well (meson only in this patch since that's what I'm developing with). It also doesn't support all regular specenum features yet.

I tried to keep the enums def format close to the packets.def format, but I'm not happy with it yet; especially when adding more options. Might have to go with two separate bodies; one for the options, then some kind of marker, then enum constants.

2023-09-24 04:23 Aktualisiert von: alienvalkyrie
Kommentar

New patch with a better definition format, support for all the specenum things, and moved the current def and generated header (but not the script) to a subdirectory.

Still missing Makefile updates to factor in the new header, because I don't trust my ability to guess how to correctly do that across different directories.

(Edited, 2023-09-24 04:26 Aktualisiert von: alienvalkyrie)
2023-09-24 05:43 Aktualisiert von: cazfi
Kommentar

Reply To alienvalkyrie

Still missing Makefile updates

Attached partial patch that should help. I hope you only need to add the include path everywhere.

Your .py seems to be missing executable bit. Not intentionally, I assume.

2023-09-24 17:01 Aktualisiert von: alienvalkyrie
  • Verantwortlicher Update from (Keine) to alienvalkyrie
  • Lösung Update from Keine to Accepted
  • Meilenstein Update from (Keine) to 3.3.0
Kommentar

Finished patch attached. Autotools build works, script is marked executable. Fixed a minor error in a comment as well.

2023-09-26 05:42 Aktualisiert von: alienvalkyrie
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

Please login to add comment to this ticket » Anmelden