msys2: Fix absolute windows paths

- Ensure path DATA_DIR isn't made absolute during compilation
- Use cygpath to create absolute path at runtime
This commit is contained in:
Greg Davill
2022-10-23 13:10:45 +10:30
parent 077f335dbd
commit 74ac8bba24
6 changed files with 64 additions and 1 deletions
+6
View File
@@ -24,6 +24,7 @@
#include "xilinxMapParser.hpp"
#include "part.hpp"
#include "progressBar.hpp"
#include "pathHelper.hpp"
Xilinx::Xilinx(Jtag *jtag, const std::string &filename,
const std::string &file_type,
@@ -323,6 +324,11 @@ bool Xilinx::load_bridge()
std::string bitname = DATA_DIR "/openFPGALoader/spiOverJtag_";
bitname += _device_package + ".bit.gz";
#if defined (_WIN64) || defined (_WIN32)
/* Convert relative path embedded at compile time to an absolute path */
bitname = PathHelper::absolutePath(bitname);
#endif
std::cout << "use: " << bitname << std::endl;
/* first: load spi over jtag */