Skip to content

Commit

Permalink
Display architecture in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravbug committed Jan 12, 2023
1 parent 70d99d3 commit c482a8d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions source/interface_derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <dirent.h>
#endif

#include <fmt/format.h>

#include <fmt/format.h>
#include <filesystem>
#if __APPLE__
Expand Down Expand Up @@ -591,13 +593,22 @@ void MainFrameDerived::LoadEditorVersions(){
auto addInstall = [this,&a,entry](const editor& e){
if (std::find(editors.begin(), editors.end(), e) == editors.end()){
//get the target architecture
#if __APPLE
auto bundlepath = e.path / entry->d_name / "Unity.app";
#if __APPLE__
auto bundlepath = e.path / e.name / "Unity.app";
auto arch = getArchitectureFromBundle(bundlepath.string().c_str());
#else
std::string archstr;
if (arch & architecture::arm64){
archstr += "arm64 ";
}
if (arch & architecture::x86_64){
archstr += "x86_64";
}

const std::string displayName = fmt::format("{} {} - {}", e.name, archstr, e.path.string());
#else
const std::string displayName = e.name + " - " + e.path.string();
#endif
a.Add(e.name + " - " + e.path.string());
a.Add(displayName);
editors.push_back(e);
}
};
Expand Down

0 comments on commit c482a8d

Please sign in to comment.