libcamera: utils: Identify the 'real' build path
Call realpath() to strip out any levels of indirection required in referencing the root build directory. This simplifies the debug output when reporting and parsing paths. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
389c19c267
commit
9e41dfbbff
1 changed files with 10 additions and 1 deletions
|
@ -386,7 +386,16 @@ std::string libcameraBuildPath()
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return std::string();
|
return std::string();
|
||||||
|
|
||||||
return dirname(info.dli_fname) + "/../../";
|
std::string path = dirname(info.dli_fname) + "/../../";
|
||||||
|
|
||||||
|
char *real = realpath(path.c_str(), nullptr);
|
||||||
|
if (!real)
|
||||||
|
return std::string();
|
||||||
|
|
||||||
|
path = real;
|
||||||
|
free(real);
|
||||||
|
|
||||||
|
return path + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue