diff options
author | 2017-08-10 21:02:52 +0200 | |
---|---|---|
committer | 2017-08-11 12:56:23 +0200 | |
commit | 43d8a79ece7dfa77a3ed1b81d732be699d1c1fe9 (patch) | |
tree | 28581b4fda4a655c55465993e602de052e32ff17 | |
parent | 523b575ac706607bcceb265f8041b502d4441968 (diff) |
Do not make generated files mandatory deps for ObjC compile when header
thinning is enabled.
PiperOrigin-RevId: 164884344
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java index 0e1f2f63d5..9dc7fc98ba 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCppSemantics.java @@ -103,17 +103,6 @@ public class ObjcCppSemantics implements CppSemantics { actionBuilder.addTransitiveMandatoryInputs(objcProvider.get(STATIC_FRAMEWORK_FILE)); actionBuilder.addTransitiveMandatoryInputs(objcProvider.get(DYNAMIC_FRAMEWORK_FILE)); - ImmutableSet.Builder<Artifact> generatedHeaders = ImmutableSet.builder(); - - // TODO(b/62060839): Identify the mechanism used to add generated headers in c++, and recycle - // it here. - for (Artifact header : objcProvider.get(HEADER)) { - if (!header.isSourceArtifact()) { - generatedHeaders.add(header); - } - } - actionBuilder.addMandatoryInputs(generatedHeaders.build()); - if (isHeaderThinningEnabled) { Artifact sourceFile = actionBuilder.getSourceFile(); if (!sourceFile.isTreeArtifact() @@ -121,6 +110,18 @@ public class ObjcCppSemantics implements CppSemantics { actionBuilder.addMandatoryInputs( ImmutableList.of(intermediateArtifacts.headersListFile(sourceFile))); } + } else { + // Header thinning feature will make all generated files mandatory inputs to the + // ObjcHeaderScanning action so this is only required when that is disabled + // TODO(b/62060839): Identify the mechanism used to add generated headers in c++, and recycle + // it here. + ImmutableSet.Builder<Artifact> generatedHeaders = ImmutableSet.builder(); + for (Artifact header : objcProvider.get(HEADER)) { + if (!header.isSourceArtifact()) { + generatedHeaders.add(header); + } + } + actionBuilder.addMandatoryInputs(generatedHeaders.build()); } } |