mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Add --relative-includes.
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
#include <cerrno>
|
||||
#include <fcntl.h>
|
||||
#include <iomanip>
|
||||
@@ -141,6 +143,14 @@ string V3Os::filenameSubstitute (const string& filename) {
|
||||
|
||||
}
|
||||
|
||||
string V3Os::filenameRealPath(const string& filename) {
|
||||
// Get rid of all the ../ behavior in the middle of the paths.
|
||||
// If there is a ../ that goes down from the 'root' of this path it is preserved.
|
||||
char retpath[PATH_MAX];
|
||||
realpath(filename.c_str(), retpath);
|
||||
return string(retpath);
|
||||
}
|
||||
|
||||
bool V3Os::filenameIsRel(const string& filename) {
|
||||
return (filename.length()>0 && filename[0] != '/');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user