Add a gyp/gn variable for whether to use iLBC or not

BUG=webrtc:5415

Review URL: https://codereview.webrtc.org/1578953003

Cr-Commit-Position: refs/heads/master@{#11291}
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 000dd39..38080af 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -23,6 +23,9 @@
   ]
 
   defines = []
+  if (rtc_include_ilbc) {
+    defines += [ "WEBRTC_CODEC_ILBC" ]
+  }
   if (rtc_include_opus) {
     defines += [ "WEBRTC_CODEC_OPUS" ]
   }
@@ -35,10 +38,7 @@
     defines += [ "WEBRTC_CODEC_G722" ]
   }
   if (!build_with_mozilla && !build_with_chromium) {
-    defines += [
-      "WEBRTC_CODEC_ILBC",
-      "WEBRTC_CODEC_RED",
-    ]
+    defines += [ "WEBRTC_CODEC_RED" ]
   }
 }
 
@@ -103,6 +103,10 @@
     "../../system_wrappers",
   ]
 
+  if (rtc_include_ilbc) {
+    defines += [ "WEBRTC_CODEC_ILBC" ]
+    deps += [ ":ilbc" ]
+  }
   if (rtc_include_opus) {
     defines += [ "WEBRTC_CODEC_OPUS" ]
     deps += [ ":webrtc_opus" ]
@@ -119,14 +123,8 @@
     deps += [ ":g722" ]
   }
   if (!build_with_mozilla && !build_with_chromium) {
-    defines += [
-      "WEBRTC_CODEC_ILBC",
-      "WEBRTC_CODEC_RED",
-    ]
-    deps += [
-      ":ilbc",
-      ":red",
-    ]
+    defines += [ "WEBRTC_CODEC_RED" ]
+    deps += [ ":red" ]
   }
 }
 
@@ -850,6 +848,10 @@
 
   defines = []
 
+  if (rtc_include_ilbc) {
+    defines += [ "WEBRTC_CODEC_ILBC" ]
+    deps += [ ":ilbc" ]
+  }
   if (rtc_include_opus) {
     defines += [ "WEBRTC_CODEC_OPUS" ]
     deps += [ ":webrtc_opus" ]
@@ -865,8 +867,4 @@
     defines += [ "WEBRTC_CODEC_G722" ]
     deps += [ ":g722" ]
   }
-  if (!build_with_mozilla && !build_with_chromium) {
-    defines += [ "WEBRTC_CODEC_ILBC" ]
-    deps += [ ":ilbc" ]
-  }
 }
diff --git a/webrtc/modules/audio_coding/audio_coding.gypi b/webrtc/modules/audio_coding/audio_coding.gypi
index abdb1915..d64fbee 100644
--- a/webrtc/modules/audio_coding/audio_coding.gypi
+++ b/webrtc/modules/audio_coding/audio_coding.gypi
@@ -32,6 +32,10 @@
     ],
     'audio_coding_defines': [],
     'conditions': [
+      ['include_ilbc==1', {
+        'audio_coding_dependencies': ['ilbc',],
+        'audio_coding_defines': ['WEBRTC_CODEC_ILBC',],
+      }],
       ['include_opus==1', {
         'audio_coding_dependencies': ['webrtc_opus',],
         'audio_coding_defines': ['WEBRTC_CODEC_OPUS',],
@@ -50,8 +54,8 @@
         'audio_coding_defines': ['WEBRTC_CODEC_G722',],
       }],
       ['build_with_mozilla==0 and build_with_chromium==0', {
-        'audio_coding_dependencies': ['ilbc', 'red',],
-        'audio_coding_defines': ['WEBRTC_CODEC_ILBC', 'WEBRTC_CODEC_RED',],
+        'audio_coding_dependencies': ['red',],
+        'audio_coding_defines': ['WEBRTC_CODEC_RED',],
       }],
     ],
   },
diff --git a/webrtc/modules/audio_coding/neteq/neteq.gypi b/webrtc/modules/audio_coding/neteq/neteq.gypi
index e424ab5..50b8425 100644
--- a/webrtc/modules/audio_coding/neteq/neteq.gypi
+++ b/webrtc/modules/audio_coding/neteq/neteq.gypi
@@ -15,6 +15,10 @@
     ],
     'neteq_defines': [],
     'conditions': [
+      ['include_ilbc==1', {
+        'codecs': ['ilbc',],
+        'neteq_defines': ['WEBRTC_CODEC_ILBC',],
+      }],
       ['include_opus==1', {
         'codecs': ['webrtc_opus',],
         'neteq_defines': ['WEBRTC_CODEC_OPUS',],
@@ -32,10 +36,6 @@
         'codecs': ['g722',],
         'neteq_defines': ['WEBRTC_CODEC_G722',],
       }],
-      ['build_with_mozilla==0 and build_with_chromium==0', {
-        'codecs': ['ilbc',],
-        'neteq_defines': ['WEBRTC_CODEC_ILBC',],
-      }],
     ],
     'neteq_dependencies': [
       '<@(codecs)',