use boost for windows path

This commit is contained in:
gmanricks 2024-04-22 00:12:43 +03:00 committed by myrtle
parent f99346ba61
commit eb0554319f
2 changed files with 5 additions and 19 deletions

View File

@ -22,6 +22,7 @@
#include "chipdb.h"
#include "log.h"
#include "nextpnr.h"
#include <boost/filesystem/convenience.hpp>
#include "command.h"
#include "placer1.h"
@ -61,16 +62,11 @@ void Arch::load_chipdb(const std::string &path)
if (!args.chipdb_override.empty()) {
db_path = args.chipdb_override;
} else {
std::string separator;
#if defined(_WIN32)
separator = "\\";
#else
separator = "/";
#endif
db_path = proc_share_dirname();
db_path += "himbaechel";
db_path += separator;
db_path += "himbaechel/";
db_path += path;
boost::filesystem::path p(db_path);
db_path = p.make_preferred().string();
}
try {
blob_file.open(db_path);

View File

@ -128,17 +128,7 @@ void GowinImpl::init_database(Arch *arch)
}
}
char separator;
#if defined(_WIN32)
separator = '\\';
#else
separator = '/';
#endif
arch->load_chipdb(stringf(
"gowin%cchipdb-%s.bin",
separator,
family.c_str()
));
arch->load_chipdb(stringf("gowin/chipdb-%s.bin", family.c_str()));
// These fields go in the header of the output JSON file and can help
// gowin_pack support different architectures