Removes unnecessary check for LinkTargetType.EXECUTABLE.
The precondition check in line 1274 makes sure that it has Staticness.STATIC.
EXECUTABLE has Staticness.DYNAMIC which precludes the checks from ever being
executed.
NO_SQ=Kokoro failing without giving an actual error.
RELNOTES:none
@@ -1318,9 +1318,7 @@ public final class CppModel {
.addVariablesExtensions(variablesExtensions)
.build();
env.registerAction(maybePicAction);
- if (linkType != LinkTargetType.EXECUTABLE) {
result.addStaticLibrary(maybePicAction.getOutputLibrary());
- }
// Create a second static library (.pic.a). Only in case (2) do we need both PIC and non-PIC
// static libraries. In that case, the first static library contains the non-PIC code, and this
@@ -1344,10 +1342,8 @@ public final class CppModel {
.addVariablesExtensions(variablesExtensions)
.build();
env.registerAction(picAction);
- if (linkType != LinkTargetType.EXECUTABLE) {
result.addPicStaticLibrary(picAction.getOutputLibrary());
}
- }
if (!createDynamicLibrary) {
return result.build();
@@ -1457,10 +1453,6 @@ public final class CppModel {
CppLinkAction dynamicLinkAction = dynamicLinkActionBuilder.build();
env.registerAction(dynamicLinkAction);
- if (linkType == LinkTargetType.EXECUTABLE) {
- return result.build();
- }
-
LibraryToLink dynamicLibrary = dynamicLinkAction.getOutputLibrary();
LibraryToLink interfaceLibrary = dynamicLinkAction.getInterfaceOutputLibrary();
if (interfaceLibrary == null) {
