Skip to content

Commit a430d8d

Browse files
Merge pull request swiftlang#247 from kateinoigakukun/katei/always-static-lib-wasm
[WASM] Always build static library for WASM
2 parents f5756c0 + 60d5dbd commit a430d8d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: lib/Driver/Driver.cpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -1432,13 +1432,18 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
14321432
OI.CompilerOutputType = file_types::TY_Object;
14331433
break;
14341434

1435-
case options::OPT_emit_library:
1436-
OI.LinkAction = Args.hasArg(options::OPT_static) ?
1437-
LinkKind::StaticLibrary :
1438-
LinkKind::DynamicLibrary;
1435+
case options::OPT_emit_library: {
1436+
// WebAssembly only support static library
1437+
if (TC.getTriple().isOSBinFormatWasm()) {
1438+
OI.LinkAction = LinkKind::StaticLibrary;
1439+
} else {
1440+
OI.LinkAction = Args.hasArg(options::OPT_static) ?
1441+
LinkKind::StaticLibrary :
1442+
LinkKind::DynamicLibrary;
1443+
}
14391444
OI.CompilerOutputType = file_types::TY_Object;
14401445
break;
1441-
1446+
}
14421447
case options::OPT_static:
14431448
break;
14441449

0 commit comments

Comments
 (0)