File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,22 @@ impl QemuRunner {
130130 machine = format ! ( "{},dumpdtb=target/qemu.dtb" , machine) ;
131131 }
132132
133- let mut cmd = self . ctx . command ( & format ! ( "qemu-system-{arch}" ) ) ;
133+ let mut qemu_executable = format ! ( "qemu-system-{}" , arch) ;
134+
135+ #[ cfg( windows) ]
136+ {
137+ println ! ( "{}" , "Checking for QEMU executable on Windows..." . blue( ) ) ;
138+ // Windows 特殊处理
139+ let msys2 =
140+ PathBuf :: from ( "C:\\ msys64\\ ucrt64\\ bin" ) . join ( format ! ( "{qemu_executable}.exe" ) ) ;
141+
142+ if msys2. exists ( ) {
143+ println ! ( "Using QEMU executable from MSYS2: {}" , msys2. display( ) ) ;
144+ qemu_executable = msys2. to_string_lossy ( ) . to_string ( ) ;
145+ }
146+ }
147+
148+ let mut cmd = self . ctx . command ( & qemu_executable) ;
134149 for arg in & self . config . args {
135150 cmd. arg ( arg) ;
136151 }
You can’t perform that action at this time.
0 commit comments