Only create the CppModuleMap action once from ObjcCompile actions.

ObjcCompile create a CcCompilationHelper twice (with and without ARC enabled).
They both did create the identical CppModuleMap action that later was found as shareable.

After this CL, the module map action is only created in one of the compile calls.

RELNOTES: None
PiperOrigin-RevId: 256506511
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
index 6be7cb5..c18335e 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
@@ -290,7 +290,8 @@
       // TODO(b/70777494): Find out how deps get used and remove if not needed.
       Iterable<? extends TransitiveInfoCollection> deps,
       ObjcCppSemantics semantics,
-      String purpose)
+      String purpose,
+      boolean generateModuleMap)
       throws RuleErrorException {
     CcCompilationHelper result =
         new CcCompilationHelper(
@@ -336,7 +337,7 @@
       result.addNonModuleMapHeader(pchHdr);
     }
 
-    if (getCustomModuleMap(ruleContext).isPresent()) {
+    if (getCustomModuleMap(ruleContext).isPresent() || !generateModuleMap) {
       result.doNotGenerateModuleMap();
     }
 
@@ -386,7 +387,8 @@
             pchHdr,
             deps,
             semantics,
-            purpose);
+            purpose,
+            /* generateModuleMap= */ true);
 
     purpose = String.format("%s_non_objc_arc", semantics.getPurpose());
     extensionBuilder.setArcEnabled(false);
@@ -404,7 +406,9 @@
             pchHdr,
             deps,
             semantics,
-            purpose);
+            purpose,
+            // Only generate the module map once (see above) and re-use it here.
+            /* generateModuleMap= */ false);
 
     FeatureConfiguration featureConfiguration =
         getFeatureConfiguration(ruleContext, ccToolchain, buildConfiguration, objcProvider);