File tree 1 file changed +7
-4
lines changed
clang/lib/Driver/ToolChains
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11
11
#include " CommonArgs.h"
12
12
#include " InputInfo.h"
13
13
#include " clang/Driver/Compilation.h"
14
+ #include " clang/Driver/Driver.h"
14
15
#include " clang/Driver/DriverDiagnostic.h"
15
16
#include " clang/Driver/Options.h"
16
17
#include " llvm/Option/ArgList.h"
@@ -38,14 +39,16 @@ char *DPURTE::GetUpmemSdkPath(const char *Path) {
38
39
asprintf (&result, " %s%s" , PathToSDK, Path);
39
40
return result;
40
41
}
42
+ const std::string SysRoot (getDriver ().SysRoot );
41
43
const std::string InstalledDir (getDriver ().getInstalledDir ());
42
44
const std::string UpmemDir (InstalledDir + " /../share/upmem" );
43
- if (getVFS ().exists (UpmemDir)) {
45
+ if (!SysRoot.empty ()) {
46
+ PathToSDK = strdup (SysRoot.c_str ());
47
+ } else if (getVFS ().exists (UpmemDir)) {
44
48
PathToSDK = strdup ((InstalledDir + " /../.." ).c_str ());
45
- asprintf (&result, " %s%s " , PathToSDK, Path);
46
- return result ;
49
+ } else {
50
+ PathToSDK = strdup (Path) ;
47
51
}
48
- PathToSDK = strdup (getenv (" UPMEM_HOME" ));
49
52
asprintf (&result, " %s%s" , PathToSDK, Path);
50
53
return result;
51
54
}
You can’t perform that action at this time.
0 commit comments