This commit is contained in:
parent
0efce16d3c
commit
aac3785738
3 changed files with 15 additions and 7 deletions
|
|
@ -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<std::string> 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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(), '-', '_');
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ int main(int argc, char* argv[]) {
|
|||
Project project(std::move(projectPath));
|
||||
|
||||
if(command == "build") {
|
||||
std::tuple<Configuration&, BuildResult> config = project.Build(argument);
|
||||
std::tuple<Configuration&, BuildResult> config = project.Build(argument);
|
||||
try {
|
||||
if(std::get<1>(config).errors.empty()) {
|
||||
if(run){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue