@@ -1369,16 +1369,22 @@ EOS";
13691369
13701370 override void performBuild ()
13711371 {
1372- getComponent(" phobos" ).needSource();
1373- getComponent(" dmd" ).needSource();
1374- getComponent(" dmd" ).needInstalled();
1375- getComponent(" phobos-includes" ).needInstalled();
1376-
13771372 foreach (model; config.build.components.common.models)
13781373 {
13791374 auto env = baseEnvironment;
13801375 needCC(env, model);
13811376
1377+ if (needHostDMD)
1378+ {
1379+ enum dmdVer = " v2.079.0" ; // Same as latest version in DMD.performBuild
1380+ needDMD(env, dmdVer);
1381+ }
1382+
1383+ getComponent(" phobos" ).needSource();
1384+ getComponent(" dmd" ).needSource();
1385+ getComponent(" dmd" ).needInstalled();
1386+ getComponent(" phobos-includes" ).needInstalled();
1387+
13821388 mkdirRecurse(sourceDir.buildPath(" import" ));
13831389 mkdirRecurse(sourceDir.buildPath(" lib" ));
13841390
@@ -1411,6 +1417,13 @@ EOS";
14111417 }
14121418 }
14131419
1420+ private bool needHostDMD ()
1421+ {
1422+ version (Windows )
1423+ return sourceDir.buildPath(" mak" , " copyimports.d" ).exists;
1424+ return false ;
1425+ }
1426+
14141427 private final void runMake (ref Environment env, string model, string target = null )
14151428 {
14161429 // Work around https://github.com/dlang/druntime/pull/2438
@@ -1421,6 +1434,7 @@ EOS";
14211434 [" -f" , makeFileNameModel(model)] ~
14221435 (target ? [target] : []) ~
14231436 [" DMD=" ~ dmd] ~
1437+ (needHostDMD ? [" HOST_DMD=" ~ env.deps.hostDC] : []) ~
14241438 config.build.components.common.makeArgs ~
14251439 getPlatformMakeVars(env, model, quotePaths) ~
14261440 dMakeArgs;
0 commit comments