This commit is contained in:
parent
60404e393c
commit
76c08dcbfd
3 changed files with 44 additions and 1 deletions
|
|
@ -175,6 +175,48 @@ namespace Crafter {
|
|||
}
|
||||
}
|
||||
|
||||
void AutoDetect() {
|
||||
std::cout << "bruh 1" << std::endl;
|
||||
fs::path exeDir = GetPath();
|
||||
std::cout << "bruh 2" << std::endl;
|
||||
fs::create_directories(exeDir/config.target);
|
||||
std::cout << "bruh 3" << std::endl;
|
||||
std::string stdPcm = std::format("{}\\{}\\std.pcm", exeDir.string(), config.target);
|
||||
std::string stdcppm = std::format("{}\\{}\\std.cppm", exeDir.string(), config.target);
|
||||
|
||||
std::cout << stdPcm << std::endl;
|
||||
std::cout << stdcppm << std::endl;
|
||||
|
||||
std::string directoryPath = RunCommand("C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe -latest -property installationPath") + "\\VC\\Tools";
|
||||
|
||||
std::cout << directoryPath << std::endl;
|
||||
|
||||
std::vector<std::string> folders;
|
||||
|
||||
// Iterate through the directory and collect all subdirectories
|
||||
for (const auto& entry : fs::directory_iterator(directoryPath+"\\MSVC")) {
|
||||
if (entry.is_directory()) {
|
||||
folders.push_back(entry.path().filename().string());
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "bruh 4" << std::endl;
|
||||
|
||||
// Sort the folders by version in descending order
|
||||
std::sort(folders.begin(), folders.end(), [](const std::string& a, const std::string& b) {
|
||||
return std::lexicographical_compare(b.begin(), b.end(), a.begin(), a.end());
|
||||
});
|
||||
|
||||
std::cout << "bruh 5" << std::endl;
|
||||
|
||||
std::string msvcVersion = folders.front();
|
||||
|
||||
std::cout << msvcVersion << std::endl;
|
||||
|
||||
clDir = std::format("{}\\MSVC\\{}\\bin\\Hostx64\\x64", directoryPath, msvcVersion);
|
||||
clangClDir = std::format("{}\\Llvm\\x64\\bin", directoryPath);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::string RunCommand(const std::string_view cmd) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue