Ticket #48702

specenum generator: Initial implementation

Date d'ouverture: 2023-09-23 06:01 Dernière mise à jour: 2023-09-26 05:42

Rapporteur:
Propriétaire:
Type:
État:
Atteints
Composant:
Jalon:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
4

Détails

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 History (3/10 Histories)

2023-09-23 06:01 Updated by: alienvalkyrie
  • New Ticket "specenum generator: Initial implementation" created
2023-09-23 06:14 Updated by: alienvalkyrie
Commentaire

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 Updated by: alienvalkyrie
Commentaire

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 Updated by: alienvalkyrie)
2023-09-24 05:43 Updated by: cazfi
Commentaire

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 Updated by: alienvalkyrie
  • Propriétaire Update from (Aucun) to alienvalkyrie
  • Résolution Update from Aucun to Accepted
  • Jalon Update from (Aucun) to 3.3.0
Commentaire

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

2023-09-26 05:42 Updated by: alienvalkyrie
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion