Fix overriding commands warnings/error

On mac, where the x86_64 architecture is disabled, and on linux when the
ART_BUILD_HOST_[N]DEBUG=false flags are set (or even the TARGET versions),
the modules referenced here aren't defined. Due to the text processing,
we end up with multiple rules defining the 'Uncompressed', 'Stripped',
etc targets:

art/build/Android.gtest.mk:97: error: overriding commands for target
`Stripped', previously defined at art/build/Android.gtest.mk:93`

These are becoming errors in this CL:

https://android-review.googlesource.com/c/platform/build/+/657896

Bug: 77611511
Test: on mac: m nothing
Test: on linux: ART_BUILD_HOST_DEBUG=false ART_BUILD_HOST_NDEBUG=false \
  ART_BUILD_TARGET_DEBUG=false ART_BUILD_TARGET_NDEBUG=false m nothing
Test: out/build-aosp_arm.ninja is the same (on linux with no args)
Change-Id: I0fec90398839fb6e3cc6443e2e37f934401dc177
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index b483e5f..be27869 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -89,43 +89,59 @@
 ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
 ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))
 
+ifdef ART_TEST_HOST_GTEST_Main_DEX
 $(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
 	cp $< $@
 	$(call dexpreopt-remove-classes.dex,$@)
+endif
 
+ifdef ART_TEST_TARGET_GTEST_Main_DEX
 $(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
 	cp $< $@
 	$(call dexpreopt-remove-classes.dex,$@)
+endif
 
+ifdef ART_TEST_HOST_GTEST_Main_DEX
 $(ART_TEST_HOST_GTEST_MainUncompressed_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) $(ZIPALIGN)
 	cp $< $@
 	$(call uncompress-dexs, $@)
 	$(call align-package, $@)
+endif
 
+ifdef ART_TEST_TARGET_GTEST_Main_DEX
 $(ART_TEST_TARGET_GTEST_MainUncompressed_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) $(ZIPALIGN)
 	cp $< $@
 	$(call uncompress-dexs, $@)
 	$(call align-package, $@)
+endif
 
+ifdef ART_TEST_HOST_GTEST_Main_DEX
 $(ART_TEST_HOST_GTEST_EmptyUncompressed_DEX): $(ZIPALIGN)
 	touch $(dir $@)classes.dex
 	zip -j -qD -X -0 $@ $(dir $@)classes.dex
 	rm $(dir $@)classes.dex
+endif
 
+ifdef ART_TEST_TARGET_GTEST_Main_DEX
 $(ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX): $(ZIPALIGN)
 	touch $(dir $@)classes.dex
 	zip -j -qD -X -0 $@ $(dir $@)classes.dex
 	rm $(dir $@)classes.dex
+endif
 
+ifdef ART_TEST_HOST_GTEST_MultiDex_DEX
 $(ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_HOST_GTEST_MultiDex_DEX) $(ZIPALIGN)
 	cp $< $@
 	$(call uncompress-dexs, $@)
 	$(call align-package, $@)
+endif
 
+ifdef ART_TEST_TARGET_GTEST_MultiDex_DEX
 $(ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_TARGET_GTEST_MultiDex_DEX) $(ZIPALIGN)
 	cp $< $@
 	$(call uncompress-dexs, $@)
 	$(call align-package, $@)
+endif
 
 ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
 ART_TEST_GTEST_VerifierDepsMulti_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDepsMulti/*.smali))