Mark the bigint target as XFA only.

Depend on it directly from the only user, fxbarcode.

Change-Id: I303dc7b0e713d683257fb3d893e74fdd40ac2046
Reviewed-on: https://pdfium-review.googlesource.com/c/43939
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 8a65f06..3e268dd 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -200,7 +200,6 @@
     ":fxge",
     ":fxjs",
     ":pwl",
-    "third_party:bigint",
     "third_party:pdfium_base",
     "third_party:skia_shared",
   ]
@@ -1815,6 +1814,7 @@
     ]
     deps = [
       ":fxcrt",
+      "third_party:bigint",
     ]
     configs += [ ":pdfium_core_config" ]
   }
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 674a847..c66ae9e 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -10,7 +10,6 @@
 
 group("third_party") {
   deps = [
-    ":bigint",
     ":pdfium_base",
     ":skia_shared",
   ]
@@ -23,24 +22,26 @@
   configs = [ "..:pdfium_common_config" ]
 }
 
-source_set("bigint") {
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    "//build/config/compiler:no_chromium_code",
-    ":pdfium_third_party_config",
-  ]
-  sources = [
-    "bigint/BigInteger.cc",
-    "bigint/BigInteger.hh",
-    "bigint/BigIntegerLibrary.hh",
-    "bigint/BigIntegerUtils.cc",
-    "bigint/BigIntegerUtils.hh",
-    "bigint/BigUnsigned.cc",
-    "bigint/BigUnsigned.hh",
-    "bigint/BigUnsignedInABase.cc",
-    "bigint/BigUnsignedInABase.hh",
-    "bigint/NumberlikeArray.hh",
-  ]
+if (pdf_enable_xfa) {
+  source_set("bigint") {
+    configs -= [ "//build/config/compiler:chromium_code" ]
+    configs += [
+      "//build/config/compiler:no_chromium_code",
+      ":pdfium_third_party_config",
+    ]
+    sources = [
+      "bigint/BigInteger.cc",
+      "bigint/BigInteger.hh",
+      "bigint/BigIntegerLibrary.hh",
+      "bigint/BigIntegerUtils.cc",
+      "bigint/BigIntegerUtils.hh",
+      "bigint/BigUnsigned.cc",
+      "bigint/BigUnsigned.hh",
+      "bigint/BigUnsignedInABase.cc",
+      "bigint/BigUnsignedInABase.hh",
+      "bigint/NumberlikeArray.hh",
+    ]
+  }
 }
 
 if (pdf_bundle_freetype) {
diff --git a/xfa/DEPS b/xfa/DEPS
index 0442a61..dba1791 100644
--- a/xfa/DEPS
+++ b/xfa/DEPS
@@ -1,7 +1,6 @@
 include_rules = [
   '+core',
   '+fxbarcode',
-  '+third_party/bigint',
 
   # xfa/fwl should be standalone. https://crbug.com/pdfium/507
   '-xfa/fwl',