Move H.264 codec test activation directly behind build flag.

Bug: None
Change-Id: I5dd366aba16b440a8e99826e116db0d6b68bf844
Reviewed-on: https://webrtc-review.googlesource.com/76621
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23231}
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index c6e30a5..12ded47 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -715,11 +715,13 @@
       "codecs/multiplex/test/multiplex_adapter_unittest.cc",
       "codecs/test/video_encoder_decoder_instantiation_tests.cc",
       "codecs/test/videocodec_test_libvpx.cc",
-      "codecs/test/videocodec_test_openh264.cc",
       "codecs/test/videocodec_test_parameterized.cc",
       "codecs/vp8/test/vp8_impl_unittest.cc",
       "codecs/vp9/test/vp9_impl_unittest.cc",
     ]
+    if (rtc_use_h264) {
+      sources += [ "codecs/test/videocodec_test_openh264.cc" ]
+    }
 
     deps = [
       ":video_codecs_test_framework",
@@ -765,10 +767,6 @@
       }
     }
 
-    if (rtc_use_h264) {
-      defines = [ "WEBRTC_USE_H264" ]
-    }
-
     if (!build_with_chromium && is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
       suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]