mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Improve error message when cl.exe is missing on Windows (#21120)
This commit is contained in:
parent
bd670444c7
commit
869266c2ef
2 changed files with 7 additions and 1 deletions
|
@ -120,6 +120,12 @@ private const(char)[] cppCommand()
|
|||
VSOptions vsopt;
|
||||
vsopt.initialize();
|
||||
const path = vsopt.compilerPath(target.isX86_64);
|
||||
//if the path to cl.exe is found, check if cl.exe is in the path.
|
||||
if(FileName.exists(path) != 1)
|
||||
{
|
||||
error(Loc.initial, "cl.exe not found. Please ensure that Visual Studio Build Tools are installed and properly configured.");
|
||||
fatal();
|
||||
}
|
||||
return toDString(path);
|
||||
}
|
||||
// Perhaps we are cross-compiling.
|
||||
|
|
|
@ -191,7 +191,7 @@ extern(C++) struct VSOptions
|
|||
* Params:
|
||||
* x64 = target architecture (x86 if false)
|
||||
* Returns:
|
||||
* absolute path to cl.exe, just "cl.exe" if not found
|
||||
* absolute path to cl.exe, and just "cl.exe" if not found
|
||||
*/
|
||||
const(char)* compilerPath(bool x64)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue