diff --git a/unit_tests/offline_compiler/main.cpp b/unit_tests/offline_compiler/main.cpp index 3b6343a8e7..4c6596e4d2 100644 --- a/unit_tests/offline_compiler/main.cpp +++ b/unit_tests/offline_compiler/main.cpp @@ -32,6 +32,7 @@ const char *fSeparator = "\\"; #elif defined(__linux__) const char *fSeparator = "/"; #endif +std::string cwd; Environment *gEnvironment; @@ -42,13 +43,19 @@ std::string getRunPath() { #if defined(__linux__) res = getcwd(nullptr, 0); #else - res = _getcwd(nullptr, 0); + res = cwd; #endif return res; } int main(int argc, char **argv) { int retVal = 0; + std::string execPath(argv[0]); + char separator = '/'; + if (execPath.find_last_of("\\") != std::string::npos) + separator = '\\'; + cwd = execPath.substr(0, execPath.find_last_of(separator)); + bool useDefaultListener = false; std::string devicePrefix("skl"); std::string familyNameWithType("Gen9core");