diff --git a/implementations/Crafter.Build-Command.cpp b/implementations/Crafter.Build-Command.cpp index ad3b160..38ea649 100644 --- a/implementations/Crafter.Build-Command.cpp +++ b/implementations/Crafter.Build-Command.cpp @@ -123,18 +123,21 @@ namespace Crafter { } void BuildMsvcStdPcm(const Project& project, const Configuration& config) { + 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::string vsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe"; - - std::string command = vsPath + " -latest -property installationPath"; + 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 folders; // Iterate through the directory and collect all subdirectories @@ -144,13 +147,19 @@ namespace Crafter { } } + 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); diff --git a/implementations/Crafter.Build-Project.cpp b/implementations/Crafter.Build-Project.cpp index 76577a4..8de5b71 100644 --- a/implementations/Crafter.Build-Project.cpp +++ b/implementations/Crafter.Build-Project.cpp @@ -238,11 +238,10 @@ namespace Crafter { } }); - std::cout << "before dir" << std::endl; fs::path exeDir = GetPath(); - std::cout << "before std" << std::endl; BuildStdPcm(*this, config); + std::cout << "after std" << std::endl; std::string editedTarget = config.target; std::replace(editedTarget.begin(), editedTarget.end(), '-', '_'); diff --git a/implementations/main.cpp b/implementations/main.cpp index c351d1e..43c35ce 100644 --- a/implementations/main.cpp +++ b/implementations/main.cpp @@ -69,7 +69,7 @@ int main(int argc, char* argv[]) { Project project(std::move(projectPath)); if(command == "build") { - std::tuple config = project.Build(argument); + std::tuple config = project.Build(argument); try { if(std::get<1>(config).errors.empty()) { if(run){