File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
clang/lib/Driver/ToolChains Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1111#include " CommonArgs.h"
1212#include " InputInfo.h"
1313#include " clang/Driver/Compilation.h"
14+ #include " clang/Driver/Driver.h"
1415#include " clang/Driver/DriverDiagnostic.h"
1516#include " clang/Driver/Options.h"
1617#include " llvm/Option/ArgList.h"
@@ -38,14 +39,16 @@ char *DPURTE::GetUpmemSdkPath(const char *Path) {
3839 asprintf (&result, " %s%s" , PathToSDK, Path);
3940 return result;
4041 }
42+ const std::string SysRoot (getDriver ().SysRoot );
4143 const std::string InstalledDir (getDriver ().getInstalledDir ());
4244 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)) {
4448 PathToSDK = strdup ((InstalledDir + " /../.." ).c_str ());
45- asprintf (&result, " %s%s " , PathToSDK, Path);
46- return result ;
49+ } else {
50+ PathToSDK = strdup (Path) ;
4751 }
48- PathToSDK = strdup (getenv (" UPMEM_HOME" ));
4952 asprintf (&result, " %s%s" , PathToSDK, Path);
5053 return result;
5154}
You can’t perform that action at this time.
0 commit comments