Skip to content

Commit 92d4b50

Browse files
authored
Merge pull request #2089 from swiftwasm/katei/default-sdk-as-wasi-sysroot
Set default sdk value as wasi-sysroot when targeting WASI OS
2 parents 16c320d + f619c7e commit 92d4b50

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
@@ -1754,6 +1754,13 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
17541754
});
17551755
}
17561756
}
1757+
} if (OI.SDKPath.empty() && TC.getTriple().isOSWASI()) {
1758+
llvm::SmallString<128> SDKPath;
1759+
llvm::sys::path::append(SDKPath, getSwiftProgramPath());
1760+
llvm::sys::path::remove_filename(SDKPath); // 'swift'
1761+
llvm::sys::path::remove_filename(SDKPath); // 'bin'
1762+
llvm::sys::path::append(SDKPath, "share", "wasi-sysroot");
1763+
OI.SDKPath = SDKPath.str().str();
17571764
}
17581765

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

0 commit comments

Comments
 (0)