builder.get_logger().log("tools", format("Visual Studio found in %s", vs_path));
- FS::Path vc_version_fn = vs_path/"VC"/"Auxiliary"/"Build"/"Microsoft.VCToolsVersion.v142.default.txt";
+ FS::Path vc_aux_build_dir = vs_path/"VC"/"Auxiliary"/"Build";
+ builder.get_logger().log("files", format("Traversing %s", vc_aux_build_dir));
+ vector<string> vc_version_files = FS::list_filtered(vc_aux_build_dir, "^Microsoft\\.VCToolsVersion\\.");
+ if(vc_version_files.empty())
+ {
+ builder.get_logger().log("problems", "MSVC tools version not found");
+ return;
+ }
+
+ sort(vc_version_files);
+ FS::Path vc_version_fn = vc_aux_build_dir/vc_version_files.back();
builder.get_logger().log("files", format("Reading %s", vc_version_fn));
char buffer[256];
unsigned len = IO::File(vc_version_fn.str()).read(buffer, sizeof(buffer));