Use central subdirectory function. Fix compile issue with Tracy

This commit is contained in:
Alexander Bock
2025-03-24 15:10:34 +01:00
parent f3583224c2
commit b1a8c82a1e
3 changed files with 10 additions and 12 deletions

View File

@@ -1416,18 +1416,15 @@ int main(int argc, char* argv[]) {
settings.hasStartedBefore = true;
const std::filesystem::path profile = global::configuration->profile;
auto isSubDirectory = [](std::filesystem::path p, std::filesystem::path root) {
while (p != p.parent_path()) {
if (p == root) {
return true;
}
p = p.parent_path();
}
return false;
};
const bool isDefaultProfile = isSubDirectory(profile, absPath("${PROFILES}"));
const bool isUserProfile = isSubDirectory(profile, absPath("${USER_PROFILES}"));
const bool isDefaultProfile = ghoul::filesystem::isSubdirectory(
profile,
absPath("${PROFILES}")
);
const bool isUserProfile = ghoul::filesystem::isSubdirectory(
profile,
absPath("${USER_PROFILES}")
);
if (isDefaultProfile) {
std::filesystem::path p = std::filesystem::relative(

View File

@@ -32,6 +32,7 @@
#include <openspace/scene/profile.h>
#include <openspace/scene/sceneinitializer.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/lua/lua_helper.h>
#include <stack>