| 120 | } |
| 121 | |
| 122 | QString getIdealPlatform(QString currentPlatform) { |
| 123 | auto info = Sys::getKernelInfo(); |
| 124 | switch(info.kernelType) { |
| 125 | case Sys::KernelType::Darwin: { |
| 126 | if(info.kernelMajor >= 17) { |
| 127 | // macOS 10.13 or newer |
| 128 | return "osx64-5.15.2"; |
| 129 | } |
| 130 | else { |
| 131 | // macOS 10.12 or older |
| 132 | return "osx64"; |
| 133 | } |
| 134 | } |
| 135 | case Sys::KernelType::Windows: { |
| 136 | // FIXME: 5.15.2 is not stable on Windows, due to a large number of completely unpredictable and hard to reproduce issues |
| 137 | break; |
| 138 | /* |
| 139 | if(info.kernelMajor == 6 && info.kernelMinor >= 1) { |
| 140 | // Windows 7 |
| 141 | return "win32-5.15.2"; |
| 142 | } |
| 143 | else if (info.kernelMajor > 6) { |
| 144 | // Above Windows 7 |
| 145 | return "win32-5.15.2"; |
| 146 | } |
| 147 | else { |
| 148 | // Below Windows 7 |
| 149 | return "win32"; |
| 150 | } |
| 151 | */ |
| 152 | } |
| 153 | case Sys::KernelType::Undetermined: |
| 154 | case Sys::KernelType::Linux: { |
| 155 | break; |
| 156 | } |
| 157 | } |
| 158 | return currentPlatform; |
| 159 | } |
| 160 | |
| 161 | } |
| 162 | |