Make xfa/ pass gn check.

Use allow_circular_includes_from as a crutch for now.

Change-Id: I1aad3276a6fd571071270090235b0cfb625e337b
Reviewed-on: https://pdfium-review.googlesource.com/c/43986
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/.gn b/.gn
index e9335c5..1d4f5fc 100644
--- a/.gn
+++ b/.gn
@@ -23,10 +23,10 @@
   "//testing/:*",
   "//testing/fuzzers/*",
   "//testing/image_diff/*",
+  "//xfa/*",
 
   # TODO(thestig): Work on these.
   #"//core/*",
   #"//fpdfsdk/*",
   #"//fxjs/*",
-  #"//xfa/*",
 ]
diff --git a/xfa/fde/BUILD.gn b/xfa/fde/BUILD.gn
index 6466f30..3c600ec 100644
--- a/xfa/fde/BUILD.gn
+++ b/xfa/fde/BUILD.gn
@@ -19,6 +19,7 @@
   ]
   deps = [
     "../../core/fxcrt",
+    "../../core/fxge",
   ]
   configs += [
     "../../:pdfium_core_config",
diff --git a/xfa/fgas/BUILD.gn b/xfa/fgas/BUILD.gn
index a6d2005..c34aa09 100644
--- a/xfa/fgas/BUILD.gn
+++ b/xfa/fgas/BUILD.gn
@@ -35,8 +35,13 @@
     "layout/cfx_txtbreak.h",
   ]
   deps = [
+    "../../core/fpdfapi/font",
+    "../../core/fpdfapi/parser",
     "../../core/fxcrt",
+    "../../core/fxge",
+    "../fde",
   ]
+  allow_circular_includes_from = [ "../fde" ]
   configs += [
     "../../:pdfium_core_config",
     "../:xfa_warnings",
diff --git a/xfa/fwl/BUILD.gn b/xfa/fwl/BUILD.gn
index 7277c32..bcccf8d 100644
--- a/xfa/fwl/BUILD.gn
+++ b/xfa/fwl/BUILD.gn
@@ -122,8 +122,12 @@
   ]
   deps = [
     "../../core/fxcrt",
+    "../../core/fxge",
     "../../fxbarcode",
+    "../fde",
     "../fgas",
+    "../fxfa/parser",
+    "../fxgraphics",
   ]
   configs += [
     "../../:pdfium_core_config",
diff --git a/xfa/fxfa/BUILD.gn b/xfa/fxfa/BUILD.gn
index 4c82ed3..e87d772 100644
--- a/xfa/fxfa/BUILD.gn
+++ b/xfa/fxfa/BUILD.gn
@@ -99,12 +99,27 @@
     "fxfa_basic.h",
   ]
   deps = [
+    "../../core/fpdfapi",
+    "../../core/fpdfapi/font",
+    "../../core/fpdfapi/parser",
+    "../../core/fpdfdoc",
+    "../../core/fxcodec",
     "../../core/fxcrt",
     "../../core/fxcrt:seekablemultistream",
     "../../core/fxcrt/css",
+    "../../core/fxge",
+    "../../fxbarcode",
     "../../fxjs",
     "../fde",
     "../fgas",
+    "../fwl",
+    "../fxgraphics",
+    "parser",
+  ]
+  allow_circular_includes_from = [
+    "../fgas",
+    "../fwl",
+    "parser",
   ]
   configs += [
     "../../:pdfium_core_config",
diff --git a/xfa/fxfa/fm2js/BUILD.gn b/xfa/fxfa/fm2js/BUILD.gn
index d34265f..8da1ec5 100644
--- a/xfa/fxfa/fm2js/BUILD.gn
+++ b/xfa/fxfa/fm2js/BUILD.gn
@@ -21,6 +21,7 @@
     "cxfa_fmtojavascriptdepth.h",
   ]
   deps = [
+    "../../../core/fxcrt",
     "//third_party/icu:icuuc",
   ]
   configs += [
diff --git a/xfa/fxfa/parser/BUILD.gn b/xfa/fxfa/parser/BUILD.gn
index 97b834a..e65428e 100644
--- a/xfa/fxfa/parser/BUILD.gn
+++ b/xfa/fxfa/parser/BUILD.gn
@@ -699,12 +699,17 @@
     "xfa_utils.h",
   ]
   deps = [
+    "../../../core/fpdfapi",
+    "../../../core/fxcodec",
     "../../../core/fxcrt",
+    "../../../core/fxge",
+    "../../../fxbarcode",
     "../../../fxjs",
     "../../fde",
     "../../fgas",
-    "../../fxfa",
+    "../../fxgraphics",
   ]
+  allow_circular_includes_from = [ "../../fgas" ]
   configs += [
     "../../../:pdfium_core_config",
     "../../:xfa_warnings",
diff --git a/xfa/fxgraphics/BUILD.gn b/xfa/fxgraphics/BUILD.gn
index 99087f6..438046c 100644
--- a/xfa/fxgraphics/BUILD.gn
+++ b/xfa/fxgraphics/BUILD.gn
@@ -24,5 +24,9 @@
     "../../:pdfium_core_config",
     "../:xfa_warnings",
   ]
+  deps = [
+    "../../core/fxcrt",
+    "../../core/fxge",
+  ]
   visibility = [ "../../*" ]
 }