3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-12-17 17:58:32 +00:00

Merge pull request #5538 from YosysHQ/emil/driver-git-hash

driver: add --git-hash
This commit is contained in:
Emil J 2025-12-09 15:00:36 +01:00 committed by GitHub
commit 1cceaa2a80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 16 deletions

View file

@ -255,6 +255,7 @@ int main(int argc, char **argv)
("h,help", "print this help message. If given, print help for <command>.",
cxxopts::value<std::string>(), "[<command>]")
("V,version", "print version information and exit")
("git-hash", "print git commit hash and exit")
("infile", "input files", cxxopts::value<std::vector<std::string>>())
;
options.add_options("logging")
@ -332,6 +333,10 @@ int main(int argc, char **argv)
std::cout << yosys_version_str << std::endl;
exit(0);
}
if (result.count("git-hash")) {
std::cout << yosys_git_hash_str << std::endl;
exit(0);
}
if (result.count("S")) {
passes_commands.push_back("synth");
run_shell = false;

View file

@ -81,6 +81,7 @@ extern std::set<std::string> yosys_input_files, yosys_output_files;
// from kernel/version_*.o (cc source generated from Makefile)
extern const char *yosys_version_str;
extern const char *yosys_git_hash_str;
const char* yosys_maybe_version();
// from passes/cmds/design.cc