From e54a3b61c0e39d265aabc1707bebedb710ff73cd Mon Sep 17 00:00:00 2001 From: moozzyk Date: Mon, 27 Apr 2015 17:26:24 -0700 Subject: [PATCH] Enabling MSBuild 14 in the default native-compile target Currently Helios won't build on machines that don't have VS2013 installed (only VS2015) --- build/_k-standard-goals.shade | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/build/_k-standard-goals.shade b/build/_k-standard-goals.shade index fe13e4a785..50c0644d77 100644 --- a/build/_k-standard-goals.shade +++ b/build/_k-standard-goals.shade @@ -83,26 +83,34 @@ default Configuration='${E("Configuration")}' #native-compile target='compile' if='!IsMono && Directory.Exists(Path.Combine(BASE_DIR, "src"))' var programFilesX86 = '${Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)}' - var msbuild = '${Path.Combine(programFilesX86, "MSBuild", "12.0", "Bin", "MSBuild.exe")}' var nativeProjects ='${Files.Include(Path.Combine(BASE_DIR, "src", "**", "*.vcxproj"))}' @{ - if (nativeProjects.Any()) + if (nativeProjects.Any()) + { + var msbuildVersions = new[] { "14.0", "12.0"}; + + for (var i = 0; i < msbuildVersions.Length; i++) { - if (!File.Exists(msbuild)) + var msbuildPath = Path.Combine(programFilesX86, "MSBuild", msbuildVersions[i], "Bin", "MSBuild.exe"); + if (File.Exists(msbuildPath)) { - Log.Warn("msbuild version 12 not found. Please ensure you have the VS 2013 C++ SDK installed."); - Environment.Exit(1); + foreach (var project in nativeProjects) + { + Exec(msbuildPath, project + " /p:Configuration=" + Configuration + ";Platform=Win32"); + Exec(msbuildPath, project + " /p:Configuration=" + Configuration + ";Platform=x64"); + } + + break; } - else + + if (i == msbuildVersions.Length - 1) { - foreach (var project in nativeProjects) - { - Exec(msbuild, project + " /p:Configuration=" + Configuration + ";Platform=Win32"); - Exec(msbuild, project + " /p:Configuration=" + Configuration + ";Platform=x64"); - } + Log.Warn("msbuild version 14 or 12 not found. Please ensure you have the VS 2015 or VS 2013 C++ SDK installed."); + Environment.Exit(1); } } + } } copy sourceDir='${Path.GetDirectoryName(project)}' include='bin/**/' outputDir='${Path.Combine(BUILD_DIR, Path.GetFileNameWithoutExtension(project))}' overwrite='${true}' each='var project in nativeProjects'