3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-19 05:42:16 +00:00

plugins: support Windows path delimiters

This commit is contained in:
Mohamed Gaber 2025-10-15 15:53:44 +03:00
parent e86797f029
commit dce70abd94
No known key found for this signature in database

View file

@ -41,6 +41,9 @@ std::map<std::string, void*> loaded_python_plugins;
std::map<std::string, std::string> loaded_plugin_aliases;
#ifdef YOSYS_ENABLE_PLUGINS
static constexpr const char *path_delimiters = fs::path::preferred_separator == '\\' ? ";" : ":" ;
inline const std::vector<fs::path> get_plugin_search_paths() {
std::vector<fs::path> result;
const char *yosys_plugin_path = std::getenv("YOSYS_PLUGIN_PATH");
@ -50,7 +53,7 @@ inline const std::vector<fs::path> get_plugin_search_paths() {
std::string copy{yosys_plugin_path};
char *token = nullptr;
char *rest = &copy[0];
while ((token = strtok_r(rest, ":", &rest))) {
while ((token = strtok_r(rest, path_delimiters, &rest))) {
result.push_back(fs::path(token));
}
}