p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
670 stars 441 forks source link

CMake is slow and generates the test files every time it is run #4542

Open fruffy opened 7 months ago

fruffy commented 7 months ago

Our CMake setup is rather slow. The slowness comes from the test files we generate unconditionally with the p4c_add_tests every time time we run cmake. It would be nice to find a way to cache the generation or only regenerate files when necessary.

Sanket-0510 commented 6 months ago

there is a command in cmake configure_file() it kind of helps in caching a file configure_file() I see p4c_add_tests macro will this a good to to cache the generation of these test files - files

fruffy commented 6 months ago

Yes, it could work. The problem is that the often generate test files in incremental fashion (by appending to the file). We would need to change that and emit the string in its entirety.