Add support for new MSBuild directory naming introduced in VS 2019.

(cherry picked from commit 7440295ad1)
This commit is contained in:
Sebastian Hartte 2019-03-20 17:55:09 +01:00 committed by Rémi Verschelde
parent 3daca13f72
commit adb9815199
1 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,7 @@
/*************************************************************************/ /*************************************************************************/
#include "mono_reg_utils.h" #include "mono_reg_utils.h"
#include "core/os/dir_access.h"
#ifdef WINDOWS_ENABLED #ifdef WINDOWS_ENABLED
@ -202,6 +203,13 @@ String find_msbuild_tools_path() {
val += "\\"; val += "\\";
} }
// Since VS2019, the directory is simply named "Current"
String msBuildDirectory = val + "MSBuild\\Current\\Bin";
if (DirAccess::exists(msBuildDirectory)) {
return msBuildDirectory;
}
// Directory name "15.0" is used in VS 2017
return val + "MSBuild\\15.0\\Bin"; return val + "MSBuild\\15.0\\Bin";
} }
} }