From 53eae2f5554a3b096d06b69b97927af6b7fb430d Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 28 Oct 2020 19:02:37 -0700 Subject: [PATCH] This patch adds support for defining the YOSYS_DATDIR location at runtime instead of at compile time. This is helpful in build systems like bazel which do not have stable locations for binaries or directories during the compilation phase. This change should be backwards compatible with the existing behavior. --- kernel/yosys.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 7a2ef4913..aee860326 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -848,6 +848,8 @@ std::string proc_share_dirname() if (check_file_exists(proc_share_path, true)) return proc_share_path; # ifdef YOSYS_DATDIR + if (std::getenv("YOSYS_DATDIR")) + return std::getenv("YOSYS_DATDIR"); proc_share_path = YOSYS_DATDIR "/"; if (check_file_exists(proc_share_path, true)) return proc_share_path;