Skip to content

Commit 6d113b8

Browse files
authored
Merge pull request #2096 from swiftwasm/katei/default-sdk-as-wasi-sysroot-5.3
Set default sdk value as wasi-sysroot when targeting WASI OS for 5.3
2 parents b4d568d + 1def3db commit 6d113b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Driver/Driver.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,13 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
17281728
});
17291729
}
17301730
}
1731+
} if (OI.SDKPath.empty() && TC.getTriple().isOSWASI()) {
1732+
llvm::SmallString<128> SDKPath;
1733+
llvm::sys::path::append(SDKPath, getSwiftProgramPath());
1734+
llvm::sys::path::remove_filename(SDKPath); // 'swift'
1735+
llvm::sys::path::remove_filename(SDKPath); // 'bin'
1736+
llvm::sys::path::append(SDKPath, "share", "wasi-sysroot");
1737+
OI.SDKPath = SDKPath.str().str();
17311738
}
17321739

17331740
if (!OI.SDKPath.empty()) {

0 commit comments

Comments
 (0)