Driver: introduce -sysroot option for non-Darwin targets

This introduces a secondary flag `-sysroot` for the non-Darwin targets,
primarily Unicies. The intention here is to support a split `-sdk`,
`-sysroot` model where the `-sdk` parameter provides the Swift "SDK"
which augments the native platform's C sysroot which is indicated as
`-sysroot`. For the case of Android, this would allow us to provide a
path to the NDK sysroot and the Swift SDK allowing us to cross-compile
Android binaries from Windows.
This commit is contained in:
Saleem Abdulrasool
2024-03-15 09:07:09 -07:00
parent 55d4a56c69
commit c8bec5b12f
6 changed files with 35 additions and 3 deletions

View File

@@ -2113,6 +2113,9 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,
if (const Arg *A = Args.getLastArg(OPT_visualc_tools_version))
Opts.setVCToolsVersion(A->getValue());
if (const Arg *A = Args.getLastArg(OPT_sysroot))
Opts.setSysRoot(A->getValue());
if (const Arg *A = Args.getLastArg(OPT_resource_dir))
Opts.RuntimeResourcePath = A->getValue();